-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
invalid format of client's host in testclient #2295
Comments
Is it even possible to get the client IP, port at this stage when the request is not made? I think you could allow specifying the client IP, port but not get them when the request is not done (at least not in a reliable way) And also the spec mentions: |
PR is welcome to set But I'll preemptively close this issue. I don't think it is a big deal. |
Setting to |
Discussed in #2109
Originally posted by pjknkda April 3, 2023
According to ASGI specification,
scope["client"]
for HTTP and Websocket protocol should have its host value in either IPv4 or IPv6 address formats.However, in
starlette/testclient.py
, the_TestClientTransport
set its host value to"testclient"
and breaks applications that expect IPv4 or IPv6 address formats during tests.starlette/starlette/testclient.py
Line 246 in f7bf741
starlette/starlette/testclient.py
Line 264 in f7bf741
Important
The text was updated successfully, but these errors were encountered: