]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#11227: use Host header in asyncore example.
authorGeorg Brandl <georg@python.org>
Sun, 6 Mar 2011 10:05:03 +0000 (11:05 +0100)
committerGeorg Brandl <georg@python.org>
Sun, 6 Mar 2011 10:05:03 +0000 (11:05 +0100)
Doc/library/asyncore.rst

index eca4d1b10e42fc13496189b28edd13564cc8ff27..b6fe2bbea2a5c6836cb19905752cf3130c773b93 100644 (file)
@@ -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