diff options
author | 无闻 <u@gogs.io> | 2015-10-24 16:51:59 -0400 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2015-10-24 16:51:59 -0400 |
commit | 379629d28ac5e4f7feb8ab6df8f0488d7dc5e69f (patch) | |
tree | 68822a9a37e6339974d2ff0151c76aff1c2bbb94 /modules | |
parent | 63e6e3127139bed511c7af3fa354927ea0ffad4f (diff) | |
parent | 8b92f9cca6c28bc8ba894ed224a7a8bbf31a0ba6 (diff) | |
download | gitea-379629d28ac5e4f7feb8ab6df8f0488d7dc5e69f.tar.gz gitea-379629d28ac5e4f7feb8ab6df8f0488d7dc5e69f.zip |
Merge pull request #1836 from likeit92/develop
workaround for reverse proxy, ssh, submodule
Diffstat (limited to 'modules')
-rw-r--r-- | modules/git/submodule.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/git/submodule.go b/modules/git/submodule.go index 0c7c2696c3..0b8efc26dc 100644 --- a/modules/git/submodule.go +++ b/modules/git/submodule.go @@ -6,6 +6,7 @@ package git import ( "strings" + "github.com/gogits/gogs/modules/setting" ) type SubModule struct { @@ -51,8 +52,14 @@ func (sf *SubModuleFile) RefUrl() string { i := strings.Index(url, "@") j := strings.LastIndex(url, ":") if i > -1 && j > -1 { - return "http://" + url[i+1:j] + "/" + url[j+1:] + // fix problem with reverse proxy works only with local server + if strings.Contains(setting.AppUrl,url[i+1:j]) { + return setting.AppUrl + url[j+1:] + } else { + return "http://" + url[i+1:j] + "/" + url[j+1:] + } } + return url } |