]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
remove content headers for 303 redirect
authorAaron Morton <aaron@the-mortons.org>
Sun, 2 Oct 2011 08:07:02 +0000 (21:07 +1300)
committerAaron Morton <aaron@the-mortons.org>
Sun, 2 Oct 2011 08:07:02 +0000 (21:07 +1300)
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

index 79a5960c31a2f57fc7b8deb1d891633340070ae0..5bf3d1585c4f11073e005f4ef56e2bfb71185522 100644 (file)
@@ -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