Skip to content

Commit

Permalink
Merge pull request #3862 from davidfischer/sustain-cors-hotfix
Browse files Browse the repository at this point in the history
Another CORS hotfix for the sustainability API
  • Loading branch information
ericholscher authored Mar 27, 2018
2 parents f4e645d + f2ac3cc commit adb5392
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 adb5392

Please sign in to comment.