From: Aaron Morton Date: Sun, 2 Oct 2011 08:07:02 +0000 (+1300) Subject: remove content headers for 303 redirect X-Git-Tag: v2.2.0~28^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cd8e08fe3092b3ccfa167b0560c42c4348989bd;p=thirdparty%2Ftornado.git 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. --- diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index 79a5960c3..5bf3d1585 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