Skip to content

Commit 5b8b935

Browse files
committed
Clear the Host header when following redirects
1 parent 907a9b4 commit 5b8b935

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tornado/simple_httpclient.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def _on_body(self, data):
298298
new_request.url = urlparse.urljoin(self.request.url,
299299
self.headers["Location"])
300300
new_request.max_redirects -= 1
301+
del new_request.headers["Host"]
301302
new_request.original_request = original_request
302303
self.client.fetch(new_request, self.callback)
303304
self.callback = None

0 commit comments

Comments
 (0)