Open babs opened 3 days ago
botbuilder-integration-aiohttp 4.16.2
botbuilder-integration-aiohttp-4.16.2 is dependant of aiohttp-3.10.5 but aiohttp-3.10.5 suffers an issue that seems to be fixed in aiohttp-3.10.7.
Issue is you can't use the Request.url property if the host header contains port or is IPv6 IP.
Request.url
Steps to reproduce the behavior:
print
request.url
I'd expect the request to not fail and get the object as expected
If applicable, add screenshots to help explain your problem.
full repro case
mkdir /tmp/aiohttp-issue cd /tmp/aiohttp-issue python3 -m venv .venv . .venv/bin/activate pip install aiohttp==3.10.5 # version botbuilder-integration-aiohttp-4.16.2 is using cat > example.py <<EOF from aiohttp import web async def hello(request): return web.Response(text=f"Hello, world: {request.url.path}") app = web.Application() app.add_routes([web.get('/', hello)]) web.run_app(app) EOF python3 example.py
output when curl localhost:8080 from another terminal:
curl localhost:8080
======== Running on http://0.0.0.0:8080 ======== (Press CTRL+C to quit) Error handling request Traceback (most recent call last): File "/tmp/aiohttp-issue/.venv/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/aiohttp-issue/.venv/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/aiohttp-issue/example.py", line 4, in hello return web.Response(text=f"Hello, world: {request.url.path}") ^^^^^^^^^^^ File "aiohttp/_helpers.pyx", line 26, in aiohttp._helpers.reify.__get__ File "/tmp/aiohttp-issue/.venv/lib/python3.12/site-packages/aiohttp/web_request.py", line 453, in url url = URL.build(scheme=self.scheme, host=self.host) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/aiohttp-issue/.venv/lib/python3.12/site-packages/yarl/_url.py", line 386, in build _host = _encode_host(host, validate_host=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/aiohttp-issue/.venv/lib/python3.12/site-packages/yarl/_url.py", line 1496, in _encode_host raise ValueError( ValueError: Host 'localhost:8080' cannot contain ':' (at position 9)
aiohttp
pip install aiohttp==3.10.7 python3 example.py
should be fixed by #2190
Version
botbuilder-integration-aiohttp 4.16.2
Describe the bug
botbuilder-integration-aiohttp-4.16.2 is dependant of aiohttp-3.10.5 but aiohttp-3.10.5 suffers an issue that seems to be fixed in aiohttp-3.10.7.
Issue is you can't use the
Request.url
property if the host header contains port or is IPv6 IP.To Reproduce
Steps to reproduce the behavior:
print
or userequest.url
Expected behavior
I'd expect the request to not fail and get the object as expected
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
full repro case
output when
curl localhost:8080
from another terminal:Upgrade
aiohttp
, it works fine