fix: cors handling after gorilla mux update (#9980)

fixes #9979
This commit is contained in:
Harshavardhana
2020-07-06 20:55:19 -07:00
committed by GitHub
parent c2f7cd1104
commit 93e7e4a0e5
3 changed files with 53 additions and 51 deletions

View File

@@ -63,8 +63,6 @@ var globalHandlers = []MiddlewareFunc{
setBrowserCacheControlHandler,
// Validates all incoming requests to have a valid date header.
setTimeValidityHandler,
// CORS setting for all browser API requests.
setCorsHandler,
// Validates all incoming URL resources, for invalid/unsupported
// resources client receives a HTTP error.
setIgnoreResourcesHandler,
@@ -114,10 +112,7 @@ func configureServerHandler(endpointZones EndpointZones) (http.Handler, error) {
// but don't allow SSE-KMS.
registerAPIRouter(router, true, false)
// If none of the routes match add default error handler routes
router.NotFoundHandler = http.HandlerFunc(httpTraceAll(errorResponseHandler))
router.MethodNotAllowedHandler = http.HandlerFunc(httpTraceAll(errorResponseHandler))
router.Use(registerMiddlewares)
return router, nil
}