From: Georg Brandl Date: Sun, 6 Mar 2011 10:05:03 +0000 (+0100) Subject: #11227: use Host header in asyncore example. X-Git-Tag: v3.2.1b1~342^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45ec333c72aaea21e95271c3b415679a2f79f269;p=thirdparty%2FPython%2Fcpython.git #11227: use Host header in asyncore example. --- diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index eca4d1b10e42..b6fe2bbea2a5 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -263,7 +263,8 @@ implement its socket handling:: asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect( (host, 80) ) - self.buffer = bytes('GET %s HTTP/1.0\r\n\r\n' % path, 'ascii') + self.buffer = bytes('GET %s HTTP/1.0\r\nHost: %s\r\n\r\n' % + (path, host), 'ascii') def handle_connect(self): pass