summaryrefslogtreecommitdiffstats
path: root/modules/private/branch.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-08-03 18:32:13 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-08-03 23:32:13 +0800
commitfa8d40facab6d3cba0bd95a3c882edfc28d478fd (patch)
treebd87049ff38735a078b4536cdb36ea707ee0c5e4 /modules/private/branch.go
parenta4ca54425f873d30e8afc323f86625e1980aa066 (diff)
downloadgitea-fa8d40facab6d3cba0bd95a3c882edfc28d478fd.tar.gz
gitea-fa8d40facab6d3cba0bd95a3c882edfc28d478fd.zip
Fix internal requests when gitea listens to unix socket or only external IP (#2234)
* Fix internal requests when gitea listens to unix socket or only external IP * When Gitea is set to listen using FastCGI use AppURL for LocalURL
Diffstat (limited to 'modules/private/branch.go')
-rw-r--r--modules/private/branch.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/private/branch.go b/modules/private/branch.go
index faee1c918a..6b3b9170bb 100644
--- a/modules/private/branch.go
+++ b/modules/private/branch.go
@@ -5,7 +5,6 @@
package private
import (
- "crypto/tls"
"encoding/json"
"fmt"
@@ -20,9 +19,7 @@ func GetProtectedBranchBy(repoID int64, branchName string) (*models.ProtectedBra
reqURL := setting.LocalURL + fmt.Sprintf("api/internal/branch/%d/%s", repoID, branchName)
log.GitLogger.Trace("GetProtectedBranchBy: %s", reqURL)
- resp, err := newRequest(reqURL, "GET").SetTLSClientConfig(&tls.Config{
- InsecureSkipVerify: true,
- }).Response()
+ resp, err := newInternalRequest(reqURL, "GET").Response()
if err != nil {
return nil, err
}