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

commented Dec 19, 2014

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

commented Dec 20, 2014

@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

This comment has been minimized.

Copy link
Contributor

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 untitaker closed this in 98b155c Dec 26, 2014

untitaker added a commit that referenced this issue Dec 26, 2014

Merge pull request #1290 from mhall1/ticket_1288
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.