You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Broken in with yarl 1.13.0+ working in 3.10.7+, contains test case: aiohttp parses port numbers as part of the host (ValueError: Host x.x.0.0:8080 cannot contain ':')
#9360
Closed
1 task done
doctorpangloss opened this issue
Sep 30, 2024
· 3 comments
Broken in 3.10.6, working in 3.10.8 - maybe this needs to be a regression test case.
Making a request to an aiohttp server which contains an address like http://10.3.39.66:9090 causes an unexpectedly flakey interaction between a middleware and web_request. For some reason, the host is being parsed to contain the port name too.
I'm not sure why this breaks sometimes in different aiohttp versions so maybe this should be added as a test case.
Logs/tracebacks
10.3.39.66 [30/Sep/2024:11:09:51 -0800] "GET /health HTTP/1.1" 500 246 "-" "kube-probe/1.29"
Error handling request
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\aiohttp\web_protocol.py", line 477, in _handle_request
resp =await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\aiohttp\web_app.py", line 559, in _handlereturnawait handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\aiohttp\web_middlewares.py", line 117, in implreturnawait handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\comfy\vendor\aiohttp_server_instrumentation.py", line 196, in middlewareor _excluded_urls.url_disabled(request.url.path)
^^^^^^^^^^^
File "aiohttp\\_helpers.pyx", line 30, in aiohttp._helpers.reify.__get__
File "C:\Python311\Lib\site-packages\aiohttp\web_request.py", line 457, in url
url =URL.build(scheme=self.scheme, host=self.host)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\yarl\_url.py", line 385, in build
netloc =cls._make_netloc(
^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\yarl\_url.py", line 1057, in _make_netloc
ret =cls._encode_host(host)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\yarl\_url.py", line 1038, in _encode_host
_host_validate(host)
File "C:\Python311\Lib\site-packages\yarl\_url.py", line 1607, in _host_validateraiseValueError(
ValueError: Host '10.3.39.72:9090' cannot contain ':' (at position 10)
bdraco
changed the title
Broken in 3.10.6, working in 3.10.8, contains test case: aiohttp parses port numbers as part of the host (ValueError: Host x.x.0.0:8080 cannot contain ':')
Broken in with yarl 1.13.0+ working in 3.10.7+, contains test case: aiohttp parses port numbers as part of the host (ValueError: Host x.x.0.0:8080 cannot contain ':')
Sep 30, 2024
Describe the bug
Broken in 3.10.6, working in 3.10.8 - maybe this needs to be a regression test case.
Making a request to an aiohttp server which contains an address like
http://10.3.39.66:9090
causes an unexpectedly flakey interaction between a middleware andweb_request
. For some reason, the host is being parsed to contain the port name too.To Reproduce
This test case reproduces with those versions:
In 3.10.8, it does not.
Expected behavior
I'm not sure why this breaks sometimes in different
aiohttp
versions so maybe this should be added as a test case.Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Windows 2022
Related component
Server
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: