Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gecBurton committed Oct 15, 2024
1 parent 98e2ab6 commit be3aa3c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions django_app/redbox_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,6 @@
)
CSP_STYLE_SRC = ("'self'",)
CSP_FRAME_ANCESTORS = ("'none'",)
CSP_CONNECT_SRC = [
"'self'",
f"{WEBSOCKET_SCHEME}://{ENVIRONMENT.hosts[0]}/ws/chat/",
"plausible.io",
"eu.i.posthog.com",
"eu-assets.i.posthog.com",
]


def get_public_ip():
Expand All @@ -213,8 +206,19 @@ def get_public_ip():

another_host = "localhost" if ENVIRONMENT.is_test else get_public_ip

CSP_CONNECT_SRC.append(f"{WEBSOCKET_SCHEME}://{another_host}/ws/chat/")
CSP_CONNECT_SRC.append(f"{WEBSOCKET_SCHEME}://{another_host}")
CSP_CONNECT_SRC = [
"'self'",
f"{WEBSOCKET_SCHEME}://{ENVIRONMENT.hosts[0]}:8090/ws/chat/",
f"{WEBSOCKET_SCHEME}://{ENVIRONMENT.hosts[0]}/ws/chat/",
f"{WEBSOCKET_SCHEME}://{ENVIRONMENT.hosts[0]}:8090",
f"{WEBSOCKET_SCHEME}://{ENVIRONMENT.hosts[0]}",
f"{WEBSOCKET_SCHEME}://{another_host}:8909/ws/chat/",
f"{WEBSOCKET_SCHEME}://{another_host}:8909",
f"{WEBSOCKET_SCHEME}://{another_host}",
"plausible.io",
"eu.i.posthog.com",
"eu-assets.i.posthog.com",
]


for csp in CSP_CONNECT_SRC:
Expand Down

0 comments on commit be3aa3c

Please sign in to comment.