From 648f225772879f676745e0c4b852133cf256fce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bojl=C3=A9n?= <2803708-taobojlen@users.noreply.gitlab.com> Date: Wed, 27 Feb 2019 09:09:23 +0000 Subject: [PATCH] Allow CORS from all fediverse.space subdomains --- backend/backend/settings/production.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/backend/settings/production.py b/backend/backend/settings/production.py index 928cc7b..3e0f690 100644 --- a/backend/backend/settings/production.py +++ b/backend/backend/settings/production.py @@ -4,9 +4,7 @@ DEBUG = False ALLOWED_HOSTS = ['backend.fediverse.space'] -CORS_ORIGIN_WHITELIST = [ - 'fediverse.space', - 'www.fediverse.space', - 'staging.fediverse.space', +CORS_ORIGIN_REGEX_WHITELIST = [ + r'^(https?:\/\/)?(\w+\.)?(.*)?fediverse-space\.netlify\.com\/?$', + r'^(https?:\/\/)?(\w+\.)?(.*)?fediverse\.space\/?$', ] -CORS_ORIGIN_REGEX_WHITELIST = (r'^(https?:\/\/)?(\w+\.)?(.*)?fediverse-space\.netlify\.com\/?$', )