Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #217: Added logic for headers=None #218

Merged
merged 1 commit into from
Apr 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions flask_cors/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def wrapped_function(*args, **kwargs):
def make_after_request_function(resources):
def cors_after_request(resp):
# If CORS headers are set in a view decorator, pass
if resp.headers.get(ACL_ORIGIN):
if resp.headers is not None and resp.headers.get(ACL_ORIGIN):
LOG.debug('CORS have been already evaluated, skipping')
return resp

Expand All @@ -183,4 +183,4 @@ def cors_after_request(resp):
else:
LOG.debug('No CORS rule matches')
return resp
return cors_after_request
return cors_after_request