From 6cd8e08fe3092b3ccfa167b0560c42c4348989bd Mon Sep 17 00:00:00 2001 From: Aaron Morton Date: Sun, 2 Oct 2011 21:07:02 +1300 Subject: [PATCH] remove content headers for 303 redirect when doing a GET request for a 303 redirect clear the Content-Length and Content-Type headers, they are set during the initial POST. --- tornado/simple_httpclient.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index 79a5960c..5bf3d158 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -361,6 +361,11 @@ class _HTTPConnection(object): if self.code == 303: new_request.method = "GET" new_request.body = None + for h in ["Content-Length", "Content-Type"]: + try: + del self.request.headers[h] + except KeyError: + pass new_request.original_request = original_request final_callback = self.final_callback self.final_callback = None