Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tna_utilities/flask/talisman.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class Talisman:

def __init__(self, app=None, **kwargs):
if app is not None:
self.app = app
self.init_app(app, **kwargs)

def init_app(
Expand Down Expand Up @@ -179,6 +178,8 @@ def _csp(
("worker-src", csp.worker_src),
]
for directive, method in property_methods:
# Intentionally pass an empty string for missing optional directives;
# CspGenerator setters treat this as "not set" while keeping call signatures consistent.
method(content_security_policy.get(directive, ""))

if "sandbox" in content_security_policy:
Expand Down
Loading