1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-20 07:00:31 +00:00

Fix for #2162 (Epub viewer isn't displaying images)

This commit is contained in:
Ozzieisaacs 2021-11-02 18:55:56 +04:00
parent a5415e00d5
commit b414d91964

View File

@ -85,6 +85,8 @@ def add_security_headers(resp):
resp.headers['Content-Security-Policy'] = "default-src 'self'" + ''.join([' '+host for host in config.config_trustedhosts.strip().split(',')]) + " 'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' data:"
if request.endpoint == "editbook.edit_book" or config.config_use_google_drive:
resp.headers['Content-Security-Policy'] += " *"
elif request.endpoint == "web.read_book":
resp.headers['Content-Security-Policy'] += " blob:;style-src-elem 'self' blob: 'unsafe-inline';"
resp.headers['X-Content-Type-Options'] = 'nosniff'
resp.headers['X-Frame-Options'] = 'SAMEORIGIN'
resp.headers['X-XSS-Protection'] = '1; mode=block'