zaunist commented on a change in pull request #2341:
URL: https://github.com/apache/apisix-dashboard/pull/2341#discussion_r824316332
##########
File path: api/internal/conf/conf.go
##########
@@ -316,3 +330,24 @@ func initParallelism(choiceCores int) {
}
runtime.GOMAXPROCS(choiceCores)
}
+
+// initialize security settings
+func initSecurity(conf Security) {
+ var se Security
+ // if conf == se, then conf is empty, we should use default value
+ if conf != se {
+ SecurityConf = conf
+ if conf.ContentSecurityPolicy == "" {
+ SecurityConf.ContentSecurityPolicy = "default-src
'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
+ }
+ if conf.XFrameOptions == "" {
+ SecurityConf.XFrameOptions = "deny"
+ }
+ return
+ }
+
+ SecurityConf = Security{
+ XFrameOptions: "deny",
+ ContentSecurityPolicy: "default-src 'self'; script-src 'self'
'unsafe-eval'; style-src 'self' 'unsafe-inline'",
+ }
Review comment:
We don't need default value for
`AllowCredentials`、`AlloOrigin`、`AllowMethods`、`AllowHeaders`. These
configuration are left to the user to customize.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]