Deploy implemented Videoreg interface and persistent theme cycle
This commit is contained in:
1 parent
6405a8d101
commit
a12eefa1de
98 files changed
+4094
-2319
No files matched your search
@@ -9,6 +9,11 @@ import re
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
OUT = ROOT / 'web-front/out'
|
||||
CSP_MATCH = re.search(r'add_header Content-Security-Policy "([^"]+)"', (ROOT / 'deploy/nginx.conf').read_text())
|
||||
if not CSP_MATCH:
|
||||
raise RuntimeError('Preview requires the actual deployment CSP')
|
||||
CONTENT_SECURITY_POLICY = CSP_MATCH.group(1)
|
||||
|
||||
|
||||
|
||||
def resolve_public(root: Path, request_path: str):
|
||||
@@ -37,6 +42,12 @@ def legacy_destination(request_path: str):
|
||||
|
||||
|
||||
class Handler(SimpleHTTPRequestHandler):
|
||||
def end_headers(self):
|
||||
self.send_header('Content-Security-Policy', CONTENT_SECURITY_POLICY)
|
||||
self.send_header('X-Content-Type-Options', 'nosniff')
|
||||
self.send_header('Referrer-Policy', 'strict-origin-when-cross-origin')
|
||||
super().end_headers()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, directory=str(OUT), **kwargs)
|
||||
|
||||
|
||||
Reference in new issue
Block a user