Fix incorrect CORS default values (#24206) (#24217)

Backport #24206 by @wxiaoguang

Document: 

```
;ALLOW_DOMAIN = *
;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
```

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
pull/24216/head^2
Giteabot 2 years ago committed by GitHub
parent f134229bf2
commit 2e6e5bc9c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      modules/setting/cors.go

@ -21,9 +21,10 @@ var CORSConfig = struct {
Headers []string Headers []string
XFrameOptions string XFrameOptions string
}{ }{
Enabled: false, AllowDomain: []string{"*"},
MaxAge: 10 * time.Minute, Methods: []string{"GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"},
Headers: []string{"Content-Type", "User-Agent"}, Headers: []string{"Content-Type", "User-Agent"},
MaxAge: 10 * time.Minute,
XFrameOptions: "SAMEORIGIN", XFrameOptions: "SAMEORIGIN",
} }

Loading…
Cancel
Save