mirror of
https://github.com/go-gitea/gitea
synced 2025-07-19 08:48:37 +00:00
Handle insecure and ports in go get (#7041)
* Handle insecure and ports in go get * Fix IsExternalURL for non-standard ports
This commit is contained in:
@@ -52,7 +52,8 @@ func IsExternalURL(rawURL string) bool {
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
if len(parsed.Host) != 0 && strings.Replace(parsed.Host, "www.", "", 1) != strings.Replace(setting.Domain, "www.", "", 1) {
|
||||
appURL, _ := url.Parse(setting.AppURL)
|
||||
if len(parsed.Host) != 0 && strings.Replace(parsed.Host, "www.", "", 1) != strings.Replace(appURL.Host, "www.", "", 1) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
Reference in New Issue
Block a user