Merge pull request #3862 from davidfischer/sustain-cors-hotfix
Another CORS hotfix for the sustainability APIhumitos/resolver/username-regex
commit
adb5392c47
|
@ -20,6 +20,7 @@ WHITELIST_URLS = [
|
||||||
'/api/v2/footer_html',
|
'/api/v2/footer_html',
|
||||||
'/api/v2/search',
|
'/api/v2/search',
|
||||||
'/api/v2/docsearch',
|
'/api/v2/docsearch',
|
||||||
|
'/api/v2/sustainability',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,6 +47,10 @@ def decide_if_cors(sender, request, **kwargs): # pylint: disable=unused-argumen
|
||||||
if request.path_info.startswith(url):
|
if request.path_info.startswith(url):
|
||||||
valid_url = True
|
valid_url = True
|
||||||
|
|
||||||
|
# Don't do domain checking for this API for now
|
||||||
|
if request.path_info.startswith('/api/v2/sustainability'):
|
||||||
|
return True
|
||||||
|
|
||||||
if valid_url:
|
if valid_url:
|
||||||
project_slug = request.GET.get('project', None)
|
project_slug = request.GET.get('project', None)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue