Skip to content

Commit 6cd8e08

Browse files
committed
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.
1 parent 1667e0b commit 6cd8e08

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tornado/simple_httpclient.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ def _on_body(self, data):
361361
if self.code == 303:
362362
new_request.method = "GET"
363363
new_request.body = None
364+
for h in ["Content-Length", "Content-Type"]:
365+
try:
366+
del self.request.headers[h]
367+
except KeyError:
368+
pass
364369
new_request.original_request = original_request
365370
final_callback = self.final_callback
366371
self.final_callback = None

0 commit comments

Comments
 (0)