-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
3.7.0 regression: aiohttp route matching is now pre url decode instead of post decode #5621
Comments
I found that by setting |
so python version just does URL(path) whereas cython does _parse_url |
This was adjusted by #5498. It was a prerequisite for fixing the security vulnerability GHSA-v6wp-4m6f-gcjg. |
The issue still occurs in 3.7.4.post0, I'll check if the difference between the python and cython still exists |
on confirmed the behavior difference between python and cython versions don't exist in 3.7.4.post0, however 3.7.4 still exhibits the behavioral change so updated description |
Could you send a PR with a failing regression test? |
Thanks, this better clarifies what exactly you expect to work.
|
Now that the regression test is in, somebody needs to dig in and figure out what do we want to adjust for this to work. I wonder if changing https://github.com/aio-libs/aiohttp/blob/09ac1cb/aiohttp/web_urldispatcher.py#L350 would be a good idea or maybe we need to make the change in the parser code 🤷♂️. |
ideally whomever made the change that caused this regression could chime in :) |
I guess. But I imagine this may block the fix for quite a while. So if anybody wants to do Git archeology and attempt to understand the best way of addressing this issue — feel free to step up and do so. |
Interesting. I doubt if I can find time for this until next week. |
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Yes, I know. They are really very useful. The good news is: the fix can land in aiohttp 3.8.1 just when it will be ready. For now, I think that some yarl bugfixes are required first. |
This won't make it into the 3.8 release stream. |
They're broken due to aio-libs/aiohttp#5621
Pre 3.7.0 (3.6.3 and before) you could write a route regex match to work on the post-decoded url, however now it swapped to pre-decode causing our route handlers to 404
💡 To Reproduce
Running the following server
with aiohttp 3.6.3 + yarl 1.5.1
and hitting
curl 'http://0.0.0.0:8888/467%2C802%2C24834%2C24952%2C25362%2C40574/hello'
results in a 200
However running the server w/ 3.7.0-3.7.4.post0 + same yarl results in 404.
📋 Your version of the Python
3.8.5
📋 Your version of the aiohttp/yarl/multidict distributions
various, see above
If I revert the changes to
_http_parser.pyx
introduced in d321923 it works again.The text was updated successfully, but these errors were encountered: