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

New router in 2.2.0 changes the behavior of strict_slashes #2467

Closed
sirosen opened this issue Jul 25, 2022 · 0 comments · Fixed by #2468
Closed

New router in 2.2.0 changes the behavior of strict_slashes #2467

sirosen opened this issue Jul 25, 2022 · 0 comments · Fixed by #2468
Assignees
Milestone

Comments

@sirosen
Copy link

sirosen commented Jul 25, 2022

Under v2.1.0 and earlier, strict_slashes=False could be used to make a routing rule for /foo match /foo/ as well.
This appears to have changed in 2.2.0 , I'm guessing in #2433

Example flask app:

# app.py
import flask
app = flask.Flask(__name__)
app.url_map.strict_slashes = False

@app.route("/foo")
def foo():
    return "hi"

and then flask run and curl localhost:5000/foo/. Under v2.1.0 you should see hi, but under 2.2.0, a 404.


I ran into this at work, as we have an app which sets strict_slashes = False and a test in our testsuite which checks for the behavior.
I don't know that we have any clients which rely on the behavior, but others might not be so lucky.

The safety/backwards-compatibility implications of this are not something I want to argue too much. If this was considered a quirk of the router and never an intended behavior, presumably it's fine to change in v2.2.0 . Otherwise, needs a fix. 🙂

If the change is considered okay, I think it's missing from the changelog. It wasn't obvious to me why our tests failed with the updated flask/werkzeug versions from the changelogs, and I had to start looking at what merged.

@davidism davidism added this to the 2.2.1 milestone Jul 25, 2022
@davidism davidism linked a pull request Jul 25, 2022 that will close this issue
6 tasks
openstack-mirroring pushed a commit to openstack/requirements that referenced this issue Jul 29, 2022
This version broke the behavior of strict_slashes=False that
ironic-inspector relies on. See this bug:
pallets/werkzeug#2467

The newly released 2.2.1 fixes it, jump straight to it.

Change-Id: I7e718345c9ec220c82689de56d367773d8e19a0b
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Jul 29, 2022
* Update requirements from branch 'master'
  to bed46f4b7ab58badcddd45e0666481eb89aedcaf
  - Exclude Werkzeug 2.2.0
    
    This version broke the behavior of strict_slashes=False that
    ironic-inspector relies on. See this bug:
    pallets/werkzeug#2467
    
    The newly released 2.2.1 fixes it, jump straight to it.
    
    Change-Id: I7e718345c9ec220c82689de56d367773d8e19a0b
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants