feat: add secure middleware (#832)

This commit is contained in:
boojack
2022-12-23 18:58:55 +08:00
committed by GitHub
parent dca35bde87
commit c07b4a57ca
2 changed files with 5 additions and 6 deletions

View File

@@ -44,6 +44,10 @@ func NewServer(profile *profile.Profile) *Server {
Timeout: 30 * time.Second,
}))
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
ContentSecurityPolicy: "default-src 'self'",
}))
embedFrontend(e)
// In dev mode, set the const secret key to make signin session persistence.