Httpx includes ipv6 scope in Host header #2180
Unanswered
elupus
asked this question in
Potential Issue
Replies: 2 comments 1 reply
-
|
Ok. I must admit I'm a bit unsure of current RFC status regarding this. Se discussion here: https://bugs.python.org/issue23448 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
It appears to me that we have the correct behaviour here... Based on RFC3986 and other searching around, it appears that IPv6 addresses in the Host header should be formatted with the enclosing square brackets. Which is what we do... import httpx
c = httpx.Client()
r = c.build_request("GET", "https://[fe80::8fd:8e9a:40d8:29a6]/get")
print(r.headers["host"]) # [fe80::8fd:8e9a:40d8:29a6]Am I misunderstanding your issue here? Is there a public address you can use to demonstrate the problem? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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:
Beta Was this translation helpful? Give feedback.
All reactions