Browse Source

fix:Handle preflight cors requests (#3496)

pull/3497/head
famosss 2 years ago
committed by GitHub
parent
commit
7eb15b1969
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      weed/s3api/s3api_server.go

4
weed/s3api/s3api_server.go

@ -90,7 +90,9 @@ func (s3a *S3ApiServer) registerRouter(router *mux.Router) {
apiRouter.Methods("OPTIONS").HandlerFunc( apiRouter.Methods("OPTIONS").HandlerFunc(
func(w http.ResponseWriter, r *http.Request) { func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Credentials", "true")
w.Header().Set("Access-Control-Expose-Headers", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
writeSuccessResponseEmpty(w, r) writeSuccessResponseEmpty(w, r)
}) })

Loading…
Cancel
Save