[New-bugs-announce] [issue5111] httplib: wrong Host header when connecting to IPv6 loopback

Guillaume Desmottes report at bugs.python.org
Fri Jan 30 17:48:59 CET 2009


New submission from Guillaume Desmottes <gdesmott at gnome.org>:

To reproduce:
- Launch a HTTP server listening on an Inet6 socket on, say, port 5555
- Try to connect using the IPv6 loopback: 
http = httplib.HTTPConnection('[::1]:5555')
http.request('GET', '/foo')
r = http.getresponse()
print r.status
- You get 400 (bad-request) instead of 404

It seems that's because the HTTP request is wrong. Python sends this header:
Host: ::1:5555
but it should be:
Host: [::1]:5555

I'm using python 2.5.2-1ubuntu1 on Intrepid.

----------
components: Library (Lib)
messages: 80827
nosy: gdesmott
severity: normal
status: open
title: httplib: wrong Host header when connecting to IPv6 loopback
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5111>
_______________________________________


More information about the New-bugs-announce mailing list