Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-29 21:26:10 +01:00

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>
This commit is contained in:
Giteabot 2023-04-19 16:23:25 -04:00 committed by GitHub
parent f134229bf2
commit 2e6e5bc9c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",
} }