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
httplib: wrong Host header when connecting to IPv6 litteral URL #49361
Comments
To reproduce:
It seems that's because the HTTP request is wrong. Python sends this header: I'm using python 2.5.2-1ubuntu1 on Intrepid. |
Actually, this bug is present when you try to connect to any URL So, we have the same problem when using, for example: but does work. Probably because we use the default HTTP port. |
As per the RFC 2732 host header should be wrapped with []. I am |
RFC 2732 Section three have the following details. host = hostname | IPv4address | IPv6reference
ipv6reference = "[" IPv6address "]" The patch contains check for : and adding the brackets |
Thanks for the patch. It would be better if you also added a test to |
Attaching the test patch |
Fixed in r86450 (py3k). Will be back porting shortly. |
r86461 (release31-maint) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: