diff options
author | Matthias Pioch <likeit.mp@googlemail.com> | 2015-10-24 22:46:13 +0200 |
---|---|---|
committer | Matthias Pioch <likeit.mp@googlemail.com> | 2015-10-24 22:46:13 +0200 |
commit | 8b92f9cca6c28bc8ba894ed224a7a8bbf31a0ba6 (patch) | |
tree | 122cc5bd79d6ea00285124a141155c5fb2c0149f /modules/git/submodule.go | |
parent | 78a4e7124507ad32ce43cd10b723224194b8e94d (diff) | |
download | gitea-8b92f9cca6c28bc8ba894ed224a7a8bbf31a0ba6.tar.gz gitea-8b92f9cca6c28bc8ba894ed224a7a8bbf31a0ba6.zip |
fix workaround for reverse proxy, ssh, submodule
Diffstat (limited to 'modules/git/submodule.go')
-rw-r--r-- | modules/git/submodule.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/git/submodule.go b/modules/git/submodule.go index 1291e112b9..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 { @@ -30,7 +31,7 @@ func NewSubModuleFile(c *Commit, refUrl, refId string) *SubModuleFile { } // RefUrl guesses and returns reference URL. -func (sf *SubModuleFile) RefUrl(appUrl string) string { +func (sf *SubModuleFile) RefUrl() string { if sf.refUrl == "" { return "" } @@ -52,8 +53,8 @@ func (sf *SubModuleFile) RefUrl(appUrl string) string { j := strings.LastIndex(url, ":") if i > -1 && j > -1 { // fix problem with reverse proxy works only with local server - if strings.Contains(appUrl,url[i+1:j]) { - return appUrl + url[j+1:] + 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:] } |