mirror of
https://github.com/gogs/gogs.git
synced 2025-05-22 15:29:56 +00:00
attachment: set CSP header in the serving endpoint (#6926)
This commit is contained in:
parent
a61a4389ec
commit
cb35b73048
@ -318,6 +318,7 @@ func runWeb(c *cli.Context) error {
|
||||
}
|
||||
defer fr.Close()
|
||||
|
||||
c.Header().Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; sandbox")
|
||||
c.Header().Set("Cache-Control", "public,max-age=86400")
|
||||
c.Header().Set("Content-Disposition", fmt.Sprintf(`inline; filename="%s"`, attach.Name))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user