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
Path matching with URLs ending in // #1688
Comments
I can't seem to find a way, even with a catch-all, to hit a double slashed ended uri. Seems like you typically need a rewrite rule to get rid of the trailing slashes. One solution would be to put an nginx reverse proxy in front of the flask app with a rewrite in the config. e.g. |
Wouldn't you consider this a bug? After all I want my route to match a certain pattern and something is preventing that. At the least I think it is unexpected behaviour. Especially since internal double slashes work ( Rewriting in an upstream proxy is some pain. Then my development environment behaves differently and I cannot unit-test those particular routes. If there's really no way to match that, can I somehow rewrite the URL in flask before the path matching happens? Thanks, |
try this
https://stackoverflow.com/questions/24000729/flask-route-using-path-with-leading-slash |
We just added a You still might have issues that Werkzeug can't address. Consecutive slashes in URLs aren't usually correct, and you should open a bug report against the client producing those URLs. Since |
I can't seem to get flask to match URLs ending in double slashes. I have a client app (that I don't control) that under some circumstances sends requests like this:
/v1/collections//
Expected Behavior
Output "found double"
Actual Behavior
I have also tried with paths:
but no luck either.
Environment
The text was updated successfully, but these errors were encountered: