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.

* Fix s3 auth failed with X-Forwarded-Host and X-Forwarded-Port (#6698)

zuzuviewer396a602f86a3
diff --git a/weed/s3api/auth_signature_v4.go b/weed/s3api/auth_signature_v4.go
index 5fce8197c9..f3b2720ee3 100644
--- a/weed/s3api/auth_signature_v4.go
+++ b/weed/s3api/auth_signature_v4.go
@@ -732,7 +732,7 @@ func extractHostHeader(r *http.Request) string {
}
}
if !isDefaultPort(r.URL.Scheme, forwardedPort) {
- extractedHost = net.JoinHostPort(forwardedHost, forwardedPort)
+ extractedHost = net.JoinHostPort(extractedHost, forwardedPort)
}
return extractedHost
} else {
@@ -743,12 +743,12 @@ func extractHostHeader(r *http.Request) string {
}
h, port, err := net.SplitHostPort(host)
if err != nil {
- return r.Host
+ return host
}
if isDefaultPort(r.URL.Scheme, port) {
return h
}
- return r.Host
+ return host
}
}