Skip to content

URL querystring missing in tracer #5432

@DurandA

Description

@DurandA

🐞 Describe the bug

The URL querystring is not propagated to params.url in tracer callbacks.

💡 To Reproduce

import aiohttp
import asyncio

async def on_request_start(session, trace_config_ctx, params):
    print(f'{repr(params.url)}')

async def main():
    trace_config = aiohttp.TraceConfig()
    trace_config.on_request_start.append(on_request_start)
    session = aiohttp.ClientSession(trace_configs=[trace_config])
    async with session:
        params = {'key1': 'value1', 'key2': 'value2'}
        async with session.get('http://httpbin.org/get', params=params) as resp:
            print(resp.url)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

💡 Expected behavior

parms.url should contain the query string (e.g. http://httpbin.org/get?key1=value1&key2=value2).

📋 Your version of the Python

Python 3.8.5

📋 Your version of the aiohttp/yarl/multidict distributions

aiohttp 3.6.2
multidict 4.7.6
yarl 1.6.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions