omit http and https ports when using X-Forwarded-Port (#6527)
This commit is contained in:
@@ -711,7 +711,7 @@ func extractHostHeader(r *http.Request) string {
|
|||||||
// If X-Forwarded-Port is set, use that too to form the host.
|
// If X-Forwarded-Port is set, use that too to form the host.
|
||||||
if forwardedHost != "" {
|
if forwardedHost != "" {
|
||||||
extractedHost := forwardedHost
|
extractedHost := forwardedHost
|
||||||
if forwardedPort != "" {
|
if forwardedPort != "" && forwardedPort != "80" && forwardedPort != "443" {
|
||||||
extractedHost = forwardedHost + ":" + forwardedPort
|
extractedHost = forwardedHost + ":" + forwardedPort
|
||||||
}
|
}
|
||||||
return extractedHost
|
return extractedHost
|
||||||
|
|||||||
Reference in New Issue
Block a user