-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
Describe the bug
After a release in yarl which had a change in behaviour for URL's update_query aio-libs/yarl#854 (comment) method, the URL received in the on_request_start tracing hook lacks the query string part.
The problem only happens with yarl version 1.9.1. It works fine with previous version which is 1.8.2
To Reproduce
- Add a tracer
- Implement
on_request_startfor the tracer - Issue a request that has a query string
- Observe that the
params.urldoes not have the query string.
Expected behavior
I expect that the URL passed within params to the tracer hook contains the query string part as well and resembles the original URL exactly.
Logs/tracebacks
See https://github.com/aio-libs/yarl/issues/854#issuecomment-1521670598 please for the exact issue that's causing this problemPython Version
$ python --version
Python 3.9.16 (main, Mar 15 2023, 15:55:54)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwinaiohttp Version
$ python -m pip show aiohttp
3.8.4multidict Version
$ python -m pip show multidict
6.0.4yarl Version
$ python -m pip show yarl
1.9.1 (the issue is not seen with version 1.8.2 as explained above)OS
macOS
Related component
Client
Additional context
In this piece of the code
Line 417 in 315ae90
| await trace.send_request_start(method, url.update_query(params), headers) |
params is None and the url actually has the query string in it. But the call to url.update_query(params) is removing the query string which is passed to the tracing hook method.
Code of Conduct
- I agree to follow the aio-libs Code of Conduct