Skip to content

Commit

Permalink
Another CORS hotfix for the sustainability API
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfischer committed Mar 27, 2018
1 parent f4e645d commit f2ac3cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions readthedocs/core/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'/api/v2/footer_html',
'/api/v2/search',
'/api/v2/docsearch',
'/api/v2/sustainability',
]


Expand All @@ -46,6 +47,10 @@ def decide_if_cors(sender, request, **kwargs): # pylint: disable=unused-argumen
if request.path_info.startswith(url):
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:
project_slug = request.GET.get('project', None)
try:
Expand Down

0 comments on commit f2ac3cc

Please sign in to comment.