Skip to content

Ensure that rules without strict slashes match paths with slashes#2468

Merged
davidism merged 2 commits intopallets:2.2.xfrom
pgjones:2.2.x
Jul 25, 2022
Merged

Ensure that rules without strict slashes match paths with slashes#2468
davidism merged 2 commits intopallets:2.2.xfrom
pgjones:2.2.x

Conversation

@pgjones
Copy link
Member

@pgjones pgjones commented Jul 25, 2022

A rule defined as /path with strict-slashes == False should match a
path /path/ but only if there isn't a rule that directly matches
/path/. This restores the previous 2.2.0 behaviour.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

This closes #2467.
This closes #2465.

@davidism davidism added this to the 2.2.1 milestone Jul 25, 2022
A rule defined as `/path` with strict-slashes == False should match a
path `/path/` but only if there isn't a rule that directly matches
`/path/`. This restores the previous 2.2.0 behaviour.
@pgjones
Copy link
Member Author

pgjones commented Jul 25, 2022

Does the ValidationError change need a changelog?

@davidism
Copy link
Member

Sure, might as well.

This matches the documented import path.
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 this pull request may close these issues.

New router in 2.2.0 changes the behavior of strict_slashes 2.2.0 breaks werkzeug.routing.ValidationError import

2 participants