fix: cors should be available on all paths (#10020)

This commit is contained in:
Harshavardhana 2020-07-11 13:49:24 -07:00 committed by GitHub
parent c0adb52213
commit 3f1902face
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -301,10 +301,7 @@ func registerAPIRouter(router *mux.Router, encryptionEnabled, allowSSEKMS bool)
maxClients(collectAPIStats("listbuckets", httpTraceAll(api.ListBucketsHandler)))) maxClients(collectAPIStats("listbuckets", httpTraceAll(api.ListBucketsHandler))))
// Supports cors only for S3 handlers // Supports cors only for S3 handlers
apiRouter.Methods(http.MethodOptions).Path(SlashSeparator).HandlerFunc( apiRouter.Methods(http.MethodOptions).HandlerFunc(
maxClients(collectAPIStats("cors", httpTraceAll(corsHandlerFunc()))))
apiRouter.Methods(http.MethodOptions).Path(SlashSeparator + SlashSeparator).HandlerFunc(
maxClients(collectAPIStats("cors", httpTraceAll(corsHandlerFunc())))) maxClients(collectAPIStats("cors", httpTraceAll(corsHandlerFunc()))))
// If none of the routes match add default error handler routes // If none of the routes match add default error handler routes