Fix go get response if only app URL is custom in configuration - #2634
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2634 +/- ##
=======================================
Coverage 27.11% 27.11%
=======================================
Files 86 86
Lines 17064 17064
=======================================
Hits 4627 4627
Misses 11759 11759
Partials 678 678Continue to review full report at Codecov.
|
e345d6f to
e4dc106
Compare
|
@lunny fixed |
|
LGTM |
|
LGTM For futur work, couldn't we set setting.Domain at appURL.Hostname globally (if domain is not set in ini) ? If it's ok I could do it. |
936dc0d to
97ee427
Compare
|
@ethantkoenig @sapk rewritten as requested and setting.Domain should now always match domain in AppURL except when AppURL has IP adress not domain in host part of URL. |
| // TODO: Can be replaced with url.Hostname() when minimal GoLang version is 1.8 | ||
| urlHostname := strings.SplitN(url.Host, ":", 2)[0] | ||
| if urlHostname != Domain && net.ParseIP(urlHostname) == nil { | ||
| Domain = urlHostname |
There was a problem hiding this comment.
Domain as it used should contain port at least for the use maid in :
Line 138 in 2ef8b8b
path.Join(setting.Domain, setting.AppSubURL, owner, repo)
There was a problem hiding this comment.
It would be better to update the ComposeGoGetImport to add HTTP_PORT
There was a problem hiding this comment.
@sapk no it should not contain port as it generates go import part of repository and go imports can not contain port
There was a problem hiding this comment.
Sorry mislead HTTP_PORT is not necessary the same as the public port ... but we still need to add the url port to the go-import.
There was a problem hiding this comment.
ok sorry that kind of strange how it works if the host is not on defaut port ?
There was a problem hiding this comment.
oh sorry I understand that the repo url after package that contain the port.
There was a problem hiding this comment.
Yes git url is generated in other place. This is just import part
|
New version LGTM. |
…tea#2634) * Fix go get response if only app URL is custom in configuration * Rewrite to update Domain setting to match AppURL
#2640) * Fix go get response if only app URL is custom in configuration * Rewrite to update Domain setting to match AppURL
Fixes #2633