aboutsummaryrefslogtreecommitdiff
path: root/pkg/setting
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-12-03 13:36:11 -0500
committerUnknwon <u@gogs.io>2018-12-03 13:36:11 -0500
commit6690023555e033ea25adb1f5bbcfac85d3ac9a25 (patch)
tree3c70feed82826852d7d91099f898ca1804843f7c /pkg/setting
parenta7e8187a0d52cb45468dec76f96a087d63c27da9 (diff)
pkg/context: use host address and apply insecure flag for go-get=1 when needed (#5305)
Diffstat (limited to 'pkg/setting')
-rw-r--r--pkg/setting/setting.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go
index 8191e4c8..b65de982 100644
--- a/pkg/setting/setting.go
+++ b/pkg/setting/setting.go
@@ -61,6 +61,7 @@ var (
AppSubURLDepth int // Number of slashes
AppPath string
AppDataPath string
+ HostAddress string // AppURL without protocol and slashes
// Server settings
Protocol Scheme
@@ -463,6 +464,7 @@ func NewContext() {
// This value is empty if site does not have sub-url.
AppSubURL = strings.TrimSuffix(url.Path, "/")
AppSubURLDepth = strings.Count(AppSubURL, "/")
+ HostAddress = url.Host
Protocol = SCHEME_HTTP
if sec.Key("PROTOCOL").String() == "https" {