mirror of
https://github.com/minio/minio.git
synced 2025-04-17 01:10:29 -04:00
federation: Redirect Lifecycle PUT request by bucket name (#11062)
The bucket forwarder handler considers MakeBucket to be always local but it mistakenly thinks that PUT bucket lifecycle to be a MakeBucket call. Fix the check of the MakeBucket call by ensuring that the query is empty in the PUT url.
This commit is contained in:
parent
d8c1f93de6
commit
d90044b847
@ -634,7 +634,7 @@ func (f bucketForwardingHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques
|
|||||||
|
|
||||||
// For browser requests, when federation is setup we need to
|
// For browser requests, when federation is setup we need to
|
||||||
// specifically handle download and upload for browser requests.
|
// specifically handle download and upload for browser requests.
|
||||||
if guessIsBrowserReq(r) && globalDNSConfig != nil && len(globalDomainNames) > 0 {
|
if globalDNSConfig != nil && len(globalDomainNames) > 0 && guessIsBrowserReq(r) {
|
||||||
var bucket, _ string
|
var bucket, _ string
|
||||||
switch r.Method {
|
switch r.Method {
|
||||||
case http.MethodPut:
|
case http.MethodPut:
|
||||||
@ -689,7 +689,7 @@ func (f bucketForwardingHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MakeBucket requests should be handled at current endpoint
|
// MakeBucket requests should be handled at current endpoint
|
||||||
if r.Method == http.MethodPut && bucket != "" && object == "" {
|
if r.Method == http.MethodPut && bucket != "" && object == "" && r.URL.RawQuery == "" {
|
||||||
f.handler.ServeHTTP(w, r)
|
f.handler.ServeHTTP(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user