Commit 45ec333c authored by Georg Brandl's avatar Georg Brandl

#11227: use Host header in asyncore example.

parent 12a6153a
...@@ -263,7 +263,8 @@ implement its socket handling:: ...@@ -263,7 +263,8 @@ implement its socket handling::
asyncore.dispatcher.__init__(self) asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect( (host, 80) ) 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): def handle_connect(self):
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment