From 45ec333c72aaea21e95271c3b415679a2f79f269 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 6 Mar 2011 11:05:03 +0100 Subject: [PATCH] #11227: use Host header in asyncore example. --- Doc/library/asyncore.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index eca4d1b10e4..b6fe2bbea2a 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