maybe fix cors headers

This commit is contained in:
Simon
2024-08-10 18:20:49 +02:00
parent 6aa8b8b05b
commit 9202a90970

View File

@@ -276,14 +276,18 @@ LOGOUT_REDIRECT_URL = "/login/"
# background.js makes the request so HTTP_ORIGIN will be from extension
if environ.get("DISABLE_CORS"):
# disable cors
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_ALL_ORIGINS = True
else:
CORS_ALLOWED_ORIGIN_REGEXES = [
r"moz-extension://*",
r"chrome-extension://*",
]
CORS_ORIGIN_WHITELIST = ["http://localhost:3000", "http://localhost:8000"]
CSRF_TRUSTED_ORIGINS = ["http://localhost:3000", "http://localhost:8000"]
CORS_ALLOWED_ORIGINS = ["http://localhost:3000"]
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_HEADERS = list(default_headers) + [
"mode",