Skip to content

Commit

Permalink
Improve handling of other regexes (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
corydolphin committed May 22, 2018
1 parent 12b0ccf commit 006e1f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flask_cors/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def probably_regex(maybe_regex):
if isinstance(maybe_regex, RegexObject):
return True
else:
common_regex_chars = ['*','\\',']', '?']
common_regex_chars = ['*', '\\', ']', '?', '$', '^', '[', ']', '(', ')']
# Use common characters used in regular expressions as a proxy
# for if this string is in fact a regex.
return any((c in maybe_regex for c in common_regex_chars))
Expand Down
2 changes: 1 addition & 1 deletion tests/extension/test_app_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def test_value_error(self):
'''

self.app = Flask(__name__)
CORS(self.app, resources="[")
CORS(self.app, resources="}")

@self.app.route('/')
def index():
Expand Down

0 comments on commit 006e1f0

Please sign in to comment.