Skip to content

Commit

Permalink
Fix Issue #217: Handle request.headers=None (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
dusktreader authored and corydolphin committed Apr 26, 2018
1 parent aab232a commit 4686c1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_cors/extension.py
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

0 comments on commit 4686c1e

Please sign in to comment.