mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
Set X-Frame-Options: DENY
This commit is contained in:
@@ -137,12 +137,13 @@ func main() {
|
||||
|
||||
// Global HTTP headers
|
||||
server.Use(func(c *fiber.Ctx) error {
|
||||
c.Set("X-Frame-Options", "SAMEORIGIN")
|
||||
c.Set("X-Frame-Options", "DENY")
|
||||
// use this if need iframe: `X-Frame-Options: SAMEORIGIN`
|
||||
c.Set("X-Content-Type-Options", "nosniff")
|
||||
c.Set("Referrer-Policy", "no-referrer")
|
||||
c.Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload")
|
||||
c.Set("Content-Security-Policy", fmt.Sprintf("default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' %s; connect-src 'self'; form-action 'self'; frame-ancestors 'none'; ", config.GetImageProxyOrigin(c)))
|
||||
// use this if need iframe: frame-ancestors 'self'
|
||||
// use this if need iframe: `frame-ancestors 'self'`
|
||||
|
||||
return c.Next()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user