use Host header on img-src 'self' data:
CSP
This commit is contained in:
parent
10b4bfa315
commit
3e1d602f97
1 changed files with 2 additions and 1 deletions
|
@ -76,11 +76,12 @@ module Invidious::Routes::BeforeAll
|
|||
|
||||
# TODO: Remove style-src's 'unsafe-inline', requires to remove all
|
||||
# inline styles (<style> [..] </style>, style=" [..] ")
|
||||
scheme = env.request.headers["X-Forwarded-Proto"]? || ("https" if CONFIG.https_only) || "http"
|
||||
env.response.headers["Content-Security-Policy"] = {
|
||||
"default-src 'none'",
|
||||
"script-src 'self'",
|
||||
"style-src 'self' 'unsafe-inline'",
|
||||
"img-src 'self' data: " + HOST_URL,
|
||||
"img-src 'self' data: " + "#{scheme}://#{env.request.headers["Host"]?}",
|
||||
"font-src 'self' data:",
|
||||
"connect-src 'self'" + extra_connect_csp,
|
||||
"manifest-src 'self'",
|
||||
|
|
Loading…
Add table
Reference in a new issue