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

Fix logging of unknown options #152

Merged
merged 1 commit into from May 1, 2016
Merged
Show file tree
Hide file tree
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
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