omit http and https ports when using X-Forwarded-Port (#6527)
Some checks failed
go: build dev binaries / cleanup (push) Has been cancelled
docker: build dev containers / build-dev-containers (push) Has been cancelled
End to End / FUSE Mount (push) Has been cancelled
go: build binary / Build (push) Has been cancelled
Ceph S3 tests / Ceph S3 tests (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, linux) (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, windows) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (amd64, darwin) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (arm64, darwin) (push) Has been cancelled

This commit is contained in:
Tom Crasset 2025-02-07 19:55:09 +01:00 committed by GitHub
parent a7b964af96
commit 9ca2b0b763
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -711,7 +711,7 @@ func extractHostHeader(r *http.Request) string {
// If X-Forwarded-Port is set, use that too to form the host.
if forwardedHost != "" {
extractedHost := forwardedHost
if forwardedPort != "" {
if forwardedPort != "" && forwardedPort != "80" && forwardedPort != "443" {
extractedHost = forwardedHost + ":" + forwardedPort
}
return extractedHost