Skip to content

Commit 91abb7a

Browse files
committed
♻️[#68] move unsafe-inline source
1 parent 157bc99 commit 91abb7a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

open_api_framework/conf/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ def init_sentry(before_send: Callable | None = None):
956956
# NOTE: make sure values are a tuple or list, and to quote special values like 'self'
957957

958958
# ideally we'd use BASE_URI but it'd have to be lazy or cause issues
959-
CSP_DEFAULT_SRC = ["'self'", "'unsafe-inline'"] + config(
959+
CSP_DEFAULT_SRC = ["'self'"] + config(
960960
"CSP_EXTRA_DEFAULT_SRC",
961961
default=[],
962962
split=True,
@@ -1021,8 +1021,11 @@ def init_sentry(before_send: Callable | None = None):
10211021

10221022
# we must include this explicitly, otherwise the style-src only includes the nonce because
10231023
# of CSP_INCLUDE_NONCE_IN
1024-
CSP_STYLE_SRC = CSP_DEFAULT_SRC + ["fonts.googleapis.com"] # used by DRF spectacular
1025-
CSP_SCRIPT_SRC = CSP_DEFAULT_SRC
1024+
CSP_STYLE_SRC = CSP_DEFAULT_SRC + [
1025+
"'unsafe-inline'",
1026+
"fonts.googleapis.com",
1027+
] # used by DRF spectacular
1028+
CSP_SCRIPT_SRC = CSP_DEFAULT_SRC + ["'unsafe-inline'"]
10261029
CSP_FONT_SRC = ("'self'", "fonts.gstatic.com")
10271030
CSP_WORKER_SRC = ("'self'", "blob:")
10281031

0 commit comments

Comments
 (0)