1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #32162 -- Fixed setting Content-Length header in AsyncRequestFactory.

This commit is contained in:
Patrick Arminio
2020-11-02 17:42:13 +00:00
committed by Mariusz Felisiak
parent b03b19b585
commit 542b4b3ab4
3 changed files with 18 additions and 2 deletions

View File

@@ -540,7 +540,7 @@ class AsyncRequestFactory(RequestFactory):
}
if data:
s['headers'].extend([
(b'content-length', bytes(len(data))),
(b'content-length', str(len(data)).encode('ascii')),
(b'content-type', content_type.encode('ascii')),
])
s['_body_file'] = FakePayload(data)