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

app.add_url_rule() should look for OPTIONS methods in a case-insensitive manner #1288

Closed
reteptilian opened this issue Dec 19, 2014 · 3 comments

Comments

@reteptilian
Copy link

add_url_rule() has logic that says that if the user has not included OPTIONS in their methods, flask will automatically provide an implementation.

Unfortunately, this logic is only triggered if the method string is OPTIONS in all upper case. So if you've included lower case "options" in your methods you will still end up with the flask-provided options functionality.

I think it should be a case-insensitive comparison since all the rest of the routing is all case-insensitive.

mhall1 added a commit to mhall1/flask that referenced this issue Dec 20, 2014
@mhall1
Copy link
Contributor

mhall1 commented Dec 20, 2014

Not exactly the most efficient solution, but I don't think the list will be long enough for it to matter. I thought it better to avoid touching anything that could be used downstream.

@untitaker
Copy link
Contributor

@mhall1 It's safe to uppercase everything in methods. Werkzeug does this anyway in Rule.__init__.

mhall1 added a commit to mhall1/flask that referenced this issue Dec 20, 2014
@mhall1
Copy link
Contributor

mhall1 commented Dec 20, 2014

@untitaker okay, fixed. Thanks for your feedback.

mhall1 added a commit to mhall1/flask that referenced this issue Dec 20, 2014
mhall1 added a commit to mhall1/flask that referenced this issue Dec 20, 2014
mhall1 added a commit to mhall1/flask that referenced this issue Dec 20, 2014
mhall1 added a commit to mhall1/flask that referenced this issue Dec 24, 2014
mhall1 added a commit to mhall1/flask that referenced this issue Dec 24, 2014
mhall1 added a commit to mhall1/flask that referenced this issue Dec 24, 2014
untitaker added a commit that referenced this issue Dec 26, 2014
Fixed #1288: app.add_url_rule() should look for OPTIONS methods in a case-insensitive manner
untitaker added a commit that referenced this issue Dec 26, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants