From dfaf15fb51ae6b132475dfea2fb21448724e71be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bror=20Bojl=C3=A9n?= Date: Wed, 20 Feb 2019 20:54:08 +0000 Subject: [PATCH] fix CORS headers --- backend/api/backend/settings/development.py | 7 +------ backend/api/backend/settings/production.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/backend/api/backend/settings/development.py b/backend/api/backend/settings/development.py index a160fb7..4c781c9 100644 --- a/backend/api/backend/settings/development.py +++ b/backend/api/backend/settings/development.py @@ -4,9 +4,4 @@ DEBUG = True ALLOWED_HOSTS = ['localhost'] -CORS_ORIGIN_WHITELIST = [ - 'localhost:3000', - 'localhost:8000', - '127.0.0.1', -] - +CORS_ORIGIN_ALLOW_ALL = True \ No newline at end of file diff --git a/backend/api/backend/settings/production.py b/backend/api/backend/settings/production.py index 68f7ece..7e44bf1 100644 --- a/backend/api/backend/settings/production.py +++ b/backend/api/backend/settings/production.py @@ -7,5 +7,5 @@ ALLOWED_HOSTS = ['api.fediverse.space'] CORS_ORIGIN_WHITELIST = [ 'fediverse.space', 'staging.fediverse.space', - '*fediverse-space.netlify.com' ] +CORS_ORIGIN_REGEX_WHITELIST = (r'^(https?:\/\/)?(\w+\.)?(.*)?fediverse-space\.netlify\.com\/?$', )