mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
Handle preflight cors requests (#3481)
This commit is contained in:
parent
f4b52d4c52
commit
bdba3da2e4
@ -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, ",")
|
||||
|
Loading…
Reference in New Issue
Block a user