0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 16:24:06 +01:00

Merge pull request #1836 from likeit92/develop

workaround for reverse proxy, ssh, submodule
This commit is contained in:
无闻 2015-10-24 16:51:59 -04:00
commit 379629d28a

View file

@ -6,6 +6,7 @@ package git
import ( import (
"strings" "strings"
"github.com/gogits/gogs/modules/setting"
) )
type SubModule struct { type SubModule struct {
@ -51,8 +52,14 @@ func (sf *SubModuleFile) RefUrl() string {
i := strings.Index(url, "@") i := strings.Index(url, "@")
j := strings.LastIndex(url, ":") j := strings.LastIndex(url, ":")
if i > -1 && j > -1 { if i > -1 && 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 "http://" + url[i+1:j] + "/" + url[j+1:]
} }
}
return url return url
} }