mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix:Handle preflight cors requests (#3496)
This commit is contained in:
parent
676e27c589
commit
7eb15b1969
|
@ -88,9 +88,11 @@ func (s3a *S3ApiServer) registerRouter(router *mux.Router) {
|
|||
apiRouter.Methods("GET").Path("/status").HandlerFunc(s3a.StatusHandler)
|
||||
|
||||
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-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)
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue