CORS_ORIGIN_REGEX_WHITELIST is missing scheme or netloc
T-101 opened this issue · comments
T-101 commented
django-cors-headers==3.2.1
settings.py:
CORS_ORIGIN_REGEX_WHITELIST = [
r"http://(?:(?:127|0)\.0\.0\.(?:0|1)|localhost):3000",
]
console:
ERRORS:
?: (corsheaders.E013) Origin '0.0.0.0:3000' in CORS_ORIGIN_WHITELIST is missing scheme or netloc
HINT: Add a scheme (e.g. https://) or netloc (e.g. example.com).
?: (corsheaders.E013) Origin '127.0.0.1:3000' in CORS_ORIGIN_WHITELIST is missing scheme or netloc
HINT: Add a scheme (e.g. https://) or netloc (e.g. example.com).
?: (corsheaders.E013) Origin 'localhost:3000' in CORS_ORIGIN_WHITELIST is missing scheme or netloc
HINT: Add a scheme (e.g. https://) or netloc (e.g. example.com).
I also tried with regex capturing groups and escaping the //
, but the results stay the same
Adam Johnson commented
You pasted the CORS_ORIGIN_WHITELIST
setting but the warning is about the non regex settingCORS_ORIGIN_WHITELIST
. Look in CORS_ORIGIN_WHITELIST
and you'll find the answer.
T-101 commented
Gah! So stupid of me. I had the settings already in place earlier in settings.py
. Sorry about this nonsense, thank you for this brilliant package and have a nice day :)