Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

app.route does not catch // when having <path:> in the directive #1778

Closed
tzickel opened this issue Apr 10, 2016 · 3 comments
Closed

app.route does not catch // when having <path:> in the directive #1778

tzickel opened this issue Apr 10, 2016 · 3 comments

Comments

@tzickel
Copy link

tzickel commented Apr 10, 2016

@app.route('/test/<path:yey>')

>>> requests.get('http://localhost:5000/test/ye')
<Response [200]>
>>> requests.get('http://localhost:5000/test//')
<Response [404]>
>>> requests.get('http://localhost:5000/test//test')
<Response [404]>
>>> requests.get('http://localhost:5000/test/ye/te')
<Response [200]>
>>> requests.get('http://localhost:5000/test/ye//te')
<Response [200]>
>>> requests.get('http://localhost:5000/test///te')
<Response [404]>
>>> requests.get('http://localhost:5000/test//a/te')
<Response [404]>
>>> requests.get('http://localhost:5000/test/a//te')
<Response [200]>

All the 404 stuff should be intercepted but aren't.

@ThiefMaster
Copy link
Member

URLs with two consecutive slashes in the path are usually garbage/broken. But I remember some issue with the dev server related to double slashes (pallets/werkzeug#822). Can you try if it also breaks when using a real WSGI container instead? gunicorn is probably the quickest way to test this.

@tzickel
Copy link
Author

tzickel commented Apr 10, 2016

Currently I only have gevent WSGI (where it happens as well).

@davidism
Copy link
Member

The regex for PathConverter matches anything that doesn't start with a /, as absolute paths are typically a bad idea to let users enter. If you need your own converter that does something different, you can write and register one the same way the others are.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants