diff --git a/weed/s3api/s3api_server.go b/weed/s3api/s3api_server.go index 0fc6af4f6..01bc102a1 100644 --- a/weed/s3api/s3api_server.go +++ b/weed/s3api/s3api_server.go @@ -87,6 +87,13 @@ func (s3a *S3ApiServer) registerRouter(router *mux.Router) { // Readiness Probe apiRouter.Methods("GET").Path("/status").HandlerFunc(s3a.StatusHandler) + apiRouter.Methods("OPTIONS").HandlerFunc( + func(w http.ResponseWriter, r *http.Request){ + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Credentials", "true") + writeSuccessResponseEmpty(w, r) + }) + var routers []*mux.Router if s3a.option.DomainName != "" { domainNames := strings.Split(s3a.option.DomainName, ",")