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.
This commit is contained in:
Aaron Morton 2011-10-02 21:07:02 +13:00
parent 1667e0b7f8
commit 6cd8e08fe3
1 changed files with 5 additions and 0 deletions

View 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