Skip to content

Commit

Permalink
Merge pull request #96 from cfpb/ghp-cors
Browse files Browse the repository at this point in the history
Allow API requests from CFPB Github Pages
  • Loading branch information
sephcoster committed Oct 4, 2019
2 parents e57b7fe + 0e6ab47 commit d59d74b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion complaint_search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ def _parse_query_params(query_params, validVars=None):
# Header methods

def _buildHeaders():
# API Documentation hosted on Github pages needs GET access
headers = {
'Access-Control-Allow-Origin': 'https://cfpb.github.io',
'Access-Control-Allow-Methods': 'GET'
}
# Local development requires CORS support
headers = {}
if settings.DEBUG:
headers = {
'Access-Control-Allow-Origin': '*',
Expand Down

0 comments on commit d59d74b

Please sign in to comment.