allow redirects to whitelisted hosts with ports

This commit is contained in:
Kamal Nasser
2019-10-11 15:39:57 +03:00
parent 62bf233682
commit bfb22506ff
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -505,7 +505,7 @@ func (p *OAuthProxy) IsValidRedirect(redirect string) bool {
return false
}
for _, domain := range p.whitelistDomains {
if (redirectURL.Host == domain) || (strings.HasPrefix(domain, ".") && strings.HasSuffix(redirectURL.Host, domain)) {
if (redirectURL.Hostname() == domain) || (strings.HasPrefix(domain, ".") && strings.HasSuffix(redirectURL.Hostname(), domain)) {
return true
}
}