Do not use EqualFold when checking u.Host (#4496)
This commit is contained in:
parent
9bb16ae49d
commit
5ca85bde2d
|
|
@ -85,7 +85,7 @@ func (c *GitHubConfig) GitHubAPIURL(path string) *url.URL {
|
||||||
result.Host = fmt.Sprintf("api.%s", c.ConfigURL.Host)
|
result.Host = fmt.Sprintf("api.%s", c.ConfigURL.Host)
|
||||||
result.Path = ""
|
result.Path = ""
|
||||||
|
|
||||||
if strings.EqualFold("www.github.com", c.ConfigURL.Host) {
|
if c.ConfigURL.Host == "www.github.com" {
|
||||||
// re-routing www.github.com to api.github.com
|
// re-routing www.github.com to api.github.com
|
||||||
result.Host = "api.github.com"
|
result.Host = "api.github.com"
|
||||||
}
|
}
|
||||||
|
|
@ -102,8 +102,8 @@ func isHostedGitHubURL(u *url.URL) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings.EqualFold(u.Host, "github.com") ||
|
return u.Host == "github.com" ||
|
||||||
strings.EqualFold(u.Host, "www.github.com") ||
|
u.Host == "www.github.com" ||
|
||||||
strings.EqualFold(u.Host, "github.localhost") ||
|
u.Host == "github.localhost" ||
|
||||||
strings.HasSuffix(u.Host, ".ghe.com")
|
strings.HasSuffix(u.Host, ".ghe.com")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue