attachment: set CSP header in the serving endpoint (#6926)

This commit is contained in:
Joe Chen
2022-05-03 17:51:28 +08:00
parent 2a8f561c64
commit bc77440b30

View File

@@ -314,6 +314,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))