Skip to content

Commit e6c4cfe

Browse files
committed
fix request content-length header erasing after post redirect
1 parent 46d1a54 commit e6c4cfe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

aiohttp/client.py

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def request(self, method, url, *,
155155
if resp.status != 307:
156156
method = hdrs.METH_GET
157157
data = None
158+
if headers.get(hdrs.CONTENT_LENGTH):
159+
headers.pop(hdrs.CONTENT_LENGTH)
158160

159161
r_url = (resp.headers.get(hdrs.LOCATION) or
160162
resp.headers.get(hdrs.URI))

0 commit comments

Comments
 (0)