-
-
Notifications
You must be signed in to change notification settings - Fork 999
Closed
Description
When requesting http paths with scope as part of the ipv6 address, this should stripped before being added to the http host header since it's fully local feature of the ipv6 stack.
Http over link local addresses is quite common on upnp based announces on link local networks.
Apache for example will reject the request: https://bz.apache.org/bugzilla/show_bug.cgi?id=35122
Lighthttpd: https://redmine.lighttpd.net/issues/2442
Example to reproduce:
import httpx
import respx
@respx.mock
def test_example():
my_route = respx.get("https://[fe80::8fd:8e9a:40d8:29a6%en0]/get")
my_route.mock(return_value=httpx.Response(204))
r = httpx.get(r'https://[fe80::8fd:8e9a:40d8:29a6%en0]/get')
print(my_route.calls[0].request.headers["host"])
assert my_route.calls[0].request.headers["host"] == "[fe80::8fd:8e9a:40d8:29a6]"
test_example()- Initially raised as discussion #...
Metadata
Metadata
Assignees
Labels
No labels