From 3f1902face6685c394ca2dd5044e067096628f9f Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 11 Jul 2020 13:49:24 -0700 Subject: [PATCH] fix: cors should be available on all paths (#10020) --- cmd/api-router.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/api-router.go b/cmd/api-router.go index 02c9f9e5d..ed11e781a 100644 --- a/cmd/api-router.go +++ b/cmd/api-router.go @@ -301,10 +301,7 @@ func registerAPIRouter(router *mux.Router, encryptionEnabled, allowSSEKMS bool) maxClients(collectAPIStats("listbuckets", httpTraceAll(api.ListBucketsHandler)))) // Supports cors only for S3 handlers - apiRouter.Methods(http.MethodOptions).Path(SlashSeparator).HandlerFunc( - maxClients(collectAPIStats("cors", httpTraceAll(corsHandlerFunc())))) - - apiRouter.Methods(http.MethodOptions).Path(SlashSeparator + SlashSeparator).HandlerFunc( + apiRouter.Methods(http.MethodOptions).HandlerFunc( maxClients(collectAPIStats("cors", httpTraceAll(corsHandlerFunc())))) // If none of the routes match add default error handler routes