Skip to content

Commit

Permalink
Fix logging of unknown options (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
corydolphin committed May 1, 2016
1 parent a2188d0 commit bddb13c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
11 changes: 7 additions & 4 deletions flask_cors/core.py
Expand Up @@ -40,7 +40,6 @@
'CORS_MAX_AGE', 'CORS_SEND_WILDCARD',
'CORS_AUTOMATIC_OPTIONS', 'CORS_VARY_HEADER',
'CORS_RESOURCES', 'CORS_INTERCEPT_EXCEPTIONS']

# Attribute added to request object by decorator to indicate that CORS
# was evaluated, in case the decorator and extension are both applied
# to a view.
Expand All @@ -52,10 +51,12 @@
DEFAULT_OPTIONS = dict(origins='*',
methods=ALL_METHODS,
allow_headers='*',
automatic_options=True,
expose_headers=None,
supports_credentials=False,
max_age=None,
send_wildcard=False,
automatic_options=True,
vary_header=True,
supports_credentials=False,
resources=r'/*',
intercept_exceptions=True)

Expand Down Expand Up @@ -287,7 +288,9 @@ def flexible_str(obj):
to ensure generated responses are consistent when iterables such as Set
are used.
"""
if(not isinstance(obj, string_types)
if obj is None:
return None
elif(not isinstance(obj, string_types)
and isinstance(obj, collections.Iterable)):
return ', '.join(str(item) for item in sorted(obj))
else:
Expand Down
8 changes: 0 additions & 8 deletions flask_cors/extension.py
Expand Up @@ -121,14 +121,6 @@ class CORS(object):
Default : True
:type vary_header: bool
:param automatic_options:
Only applies to the `cross_origin` decorator. If True, Flask-CORS will
override Flask's default OPTIONS handling to return CORS headers for
OPTIONS requests.
Default : True
:type automatic_options: bool
"""

def __init__(self, app=None, **kwargs):
Expand Down

0 comments on commit bddb13c

Please sign in to comment.