diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index 0c4aef3c2..626a129ee 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -228,7 +228,8 @@ func guessIsRPCReq(req *http.Request) bool { if req == nil { return false } - return req.Method == http.MethodPost + return req.Method == http.MethodPost && + strings.HasPrefix(req.URL.Path, minioReservedBucketPath+"/") } func (h redirectHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { diff --git a/cmd/generic-handlers_test.go b/cmd/generic-handlers_test.go index 19e65b2a0..6c0ccf5e7 100644 --- a/cmd/generic-handlers_test.go +++ b/cmd/generic-handlers_test.go @@ -78,9 +78,16 @@ func TestGuessIsRPC(t *testing.T) { if guessIsRPCReq(nil) { t.Fatal("Unexpected return for nil request") } + + u, err := url.Parse("http://localhost:9000/minio/lock") + if err != nil { + t.Fatal(err) + } + r := &http.Request{ Proto: "HTTP/1.0", Method: http.MethodPost, + URL: u, } if !guessIsRPCReq(r) { t.Fatal("Test shouldn't fail for a possible net/rpc request.")