From 9ca2b0b763e8e546bf9773191f591f079e2b3ce8 Mon Sep 17 00:00:00 2001 From: Tom Crasset <25140344+tcrasset@users.noreply.github.com> Date: Fri, 7 Feb 2025 19:55:09 +0100 Subject: [PATCH] omit http and https ports when using X-Forwarded-Port (#6527) --- weed/s3api/auth_signature_v4.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/s3api/auth_signature_v4.go b/weed/s3api/auth_signature_v4.go index 43ca851fc..7ee761a67 100644 --- a/weed/s3api/auth_signature_v4.go +++ b/weed/s3api/auth_signature_v4.go @@ -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