Skip to content

Commit 2e6e5bc

Browse files
GiteaBotwxiaoguang
andauthored
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 <[email protected]>
1 parent f134229 commit 2e6e5bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/setting/cors.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ var CORSConfig = struct {
2121
Headers []string
2222
XFrameOptions string
2323
}{
24-
Enabled: false,
25-
MaxAge: 10 * time.Minute,
24+
AllowDomain: []string{"*"},
25+
Methods: []string{"GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"},
2626
Headers: []string{"Content-Type", "User-Agent"},
27+
MaxAge: 10 * time.Minute,
2728
XFrameOptions: "SAMEORIGIN",
2829
}
2930

0 commit comments

Comments
 (0)