summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-03-06 10:05:03 (GMT)
committerGeorg Brandl <georg@python.org>2011-03-06 10:05:03 (GMT)
commit45ec333c72aaea21e95271c3b415679a2f79f269 (patch)
treeaf0b24cf0d1ddab68c46513150a539cc536179f0 /Doc
parent12a6153aeed41b6ef6bea93fa62427a3c5f7de56 (diff)
downloadcpython-45ec333c72aaea21e95271c3b415679a2f79f269.zip
cpython-45ec333c72aaea21e95271c3b415679a2f79f269.tar.gz
cpython-45ec333c72aaea21e95271c3b415679a2f79f269.tar.bz2
#11227: use Host header in asyncore example.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/asyncore.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst
index eca4d1b..b6fe2bb 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