mirror of
https://github.com/gogs/gogs.git
synced 2026-05-06 11:25:54 +02:00
pkg/context: use host address and apply insecure flag for go-get=1 when needed (#5305)
This commit is contained in:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user