diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-20 03:30:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 15:30:10 -0400 |
commit | 94210633ae64dcd1f5f9bdb046f888be526fe2da (patch) | |
tree | cd46af9e3e9babe18cf8d527217d195cff200763 /modules/setting | |
parent | 52b17bfa07fea29441cd961da4edaf1ea97fe348 (diff) | |
download | gitea-94210633ae64dcd1f5f9bdb046f888be526fe2da.tar.gz gitea-94210633ae64dcd1f5f9bdb046f888be526fe2da.zip |
Fix incorrect CORS default values (#24206)
Document:
```
;ALLOW_DOMAIN = *
;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
```
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/cors.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/setting/cors.go b/modules/setting/cors.go index 260848b5df..bafbbab64f 100644 --- a/modules/setting/cors.go +++ b/modules/setting/cors.go @@ -21,9 +21,10 @@ var CORSConfig = struct { Headers []string XFrameOptions string }{ - Enabled: false, - MaxAge: 10 * time.Minute, + AllowDomain: []string{"*"}, + Methods: []string{"GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"}, Headers: []string{"Content-Type", "User-Agent"}, + MaxAge: 10 * time.Minute, XFrameOptions: "SAMEORIGIN", } |