add a page for tickets from gitea (#2)
Co-authored-by: Blake Ridgway <blake@blakeridgway.com> Reviewed-on: #2
This commit is contained in:
@@ -43,8 +43,12 @@ func SecurityHeadersMiddleware(next http.Handler) http.Handler {
|
||||
if strings.HasPrefix(r.URL.Path, "/admin") {
|
||||
scriptSrc = "'self'"
|
||||
}
|
||||
w.Header().Set("Content-Security-Policy",
|
||||
"default-src 'self'; script-src "+scriptSrc+"; style-src 'self'; img-src 'self' data:; font-src 'self'; frame-ancestors 'none'")
|
||||
frameSrc := "'none'"
|
||||
if r.URL.Path == "/stream" {
|
||||
frameSrc = "https://player.twitch.tv"
|
||||
}
|
||||
csp := "default-src 'self'; script-src " + scriptSrc + "; style-src 'self'; img-src 'self' data:; font-src 'self'; frame-src " + frameSrc + "; frame-ancestors 'none'"
|
||||
w.Header().Set("Content-Security-Policy", csp)
|
||||
w.Header().Set("X-Frame-Options", "DENY")
|
||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin")
|
||||
|
||||
Reference in New Issue
Block a user