Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

omit http and https ports when using X-Forwarded-Port (#6527)

Tom Crasset9ca2b0b763e8
diff --git a/weed/s3api/auth_signature_v4.go b/weed/s3api/auth_signature_v4.go
index 43ca851fc5..7ee761a67d 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