mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Whitelist CDN used by playground (#2139)
This commit is contained in:
committed by
GitHub
parent
bf1b835d6d
commit
65b8a3fe96
@@ -352,12 +352,15 @@ func SecurityHeadersMiddleware(next http.Handler) http.Handler {
|
|||||||
// Allows websocket requests to any origin
|
// Allows websocket requests to any origin
|
||||||
connectableOrigins += " ws: wss:"
|
connectableOrigins += " ws: wss:"
|
||||||
|
|
||||||
|
// The graphql playground pulls its frontend from a cdn
|
||||||
|
connectableOrigins += " https://cdn.jsdelivr.net "
|
||||||
|
|
||||||
if !c.IsNewSystem() && c.GetHandyKey() != "" {
|
if !c.IsNewSystem() && c.GetHandyKey() != "" {
|
||||||
connectableOrigins += " https://www.handyfeeling.com"
|
connectableOrigins += " https://www.handyfeeling.com"
|
||||||
}
|
}
|
||||||
connectableOrigins += "; "
|
connectableOrigins += "; "
|
||||||
|
|
||||||
cspDirectives := "default-src data: 'self' 'unsafe-inline';" + connectableOrigins + "img-src data: *; script-src 'self' 'unsafe-inline'; media-src 'self' blob:; child-src 'none'; object-src 'none'; form-action 'self'"
|
cspDirectives := "default-src data: 'self' 'unsafe-inline';" + connectableOrigins + "img-src data: *; script-src 'self' https://cdn.jsdelivr.net 'unsafe-inline'; media-src 'self' blob:; child-src 'none'; object-src 'none'; form-action 'self'"
|
||||||
|
|
||||||
w.Header().Set("Referrer-Policy", "same-origin")
|
w.Header().Set("Referrer-Policy", "same-origin")
|
||||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||||
|
|||||||
Reference in New Issue
Block a user