From: Ben Darnell Date: Sat, 19 Feb 2011 23:35:37 +0000 (-0800) Subject: Clear the Host header when following redirects X-Git-Tag: v1.2.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b8b935ed9d0c5c6ec8cdf91204d14a7bf73c32e;p=thirdparty%2Ftornado.git Clear the Host header when following redirects --- diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index 2747f04ae..d6be72fc6 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -298,6 +298,7 @@ class _HTTPConnection(object): new_request.url = urlparse.urljoin(self.request.url, self.headers["Location"]) new_request.max_redirects -= 1 + del new_request.headers["Host"] new_request.original_request = original_request self.client.fetch(new_request, self.callback) self.callback = None