Browse Source
* Fix s3 auth failed with X-Forwarded-Host and X-Forwarded-Port (#6698)
pull/5783/merge
zuzuviewer
6 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
3 deletions
-
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 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|