[Python-checkins] cpython (3.1): #11227: use Host header in asyncore example.

georg.brandl python-checkins at python.org
Sun Mar 6 11:10:10 CET 2011


http://hg.python.org/cpython/rev/b630a135a86c
changeset:   68287:b630a135a86c
branch:      3.1
user:        Georg Brandl <georg at python.org>
date:        Sun Mar 06 11:05:03 2011 +0100
summary:
  #11227: use Host header in asyncore example.

files:
  Doc/library/asyncore.rst

diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst
--- a/Doc/library/asyncore.rst
+++ b/Doc/library/asyncore.rst
@@ -263,7 +263,8 @@
            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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list