From 26c4d3ab1ce9c36d118788a1a3a6e8424497e006 Mon Sep 17 00:00:00 2001 From: Daniel Cortes Date: Wed, 3 Jun 2020 15:59:27 -0400 Subject: [PATCH] Regex para cors en localhost --- musiclist/settings/prod.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/musiclist/settings/prod.py b/musiclist/settings/prod.py index feb9286..1e6e597 100644 --- a/musiclist/settings/prod.py +++ b/musiclist/settings/prod.py @@ -5,7 +5,13 @@ SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY') ALLOWED_HOSTS = ['musiclist-api.danielcortes.xyz'] CORS_ORIGIN_ALLOW_ALL = False -CORS_ORIGIN_WHITELIST = ['musiclist.danielcortes.xyz', 'localhost', '127.0.0.1'] +CORS_ORIGIN_WHITELIST = [ + 'musiclist.danielcortes.xyz', +] +CORS_ORIGIN_REGEX_WHITELIST = [ + 'localhost((:\d)\d{0,3})?', + '127.0.0.1((:\d)\d{0,3})?', +] """Security""" SECURE_HSTS_SECONDS = 31536000