From 0dd626ec6761b720fe234df3ebf25af42062aef3 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 7 May 2020 11:49:04 -0700 Subject: [PATCH] fix: requests without bucket should route to the original router (#9541) requests in federated setups for STS type calls which are performed at '/' resource should be routed by the muxer, the assumption is simply such that requests without a bucket in a federated setup cannot be proxied, so serve them at current server. --- cmd/generic-handlers.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index 32ea7c9f0..0cb7bc433 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -679,9 +679,12 @@ func (f bucketForwardingHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques bucket, object := request2BucketObjectName(r) - // ListBucket requests should be handled at current endpoint as - // all buckets data can be fetched from here. - if r.Method == http.MethodGet && bucket == "" && object == "" { + // Requests in federated setups for STS type calls which are + // performed at '/' resource should be routed by the muxer, + // the assumption is simply such that requests without a bucket + // in a federated setup cannot be proxied, so serve them at + // current server. + if bucket == "" { f.handler.ServeHTTP(w, r) return }