]> git.ipfire.org Git - thirdparty/httpx.git/commit
Prefer `Content-Length` over `Transfer-Encoding: chunked` for `content=<file-like...
authorTom Christie <tom@tomchristie.com>
Fri, 30 Apr 2021 09:40:42 +0000 (10:40 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Apr 2021 09:40:42 +0000 (10:40 +0100)
commit2129a9789ad6a9ffb8655644fbe43a5b3e908db9
treecc5277db9148d795137463cfcfd07ffe4da2597e
parent54f4194c387e1817f958ba8c25710d551cec278a
Prefer `Content-Length` over `Transfer-Encoding: chunked` for `content=<file-like>` cases. (#1619)

* Add failing test case for 'content=io.BytesIO(...)'

* Refactor peek_filelike_length to return an Optional[int]

* Peek filelength on file-like objects when rendering 'content=...'
httpx/_content.py
httpx/_multipart.py
httpx/_utils.py
tests/test_content.py