1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Fix --offline --chunked, add more tests

This commit is contained in:
Jakub Roztocil
2020-09-28 16:40:16 +02:00
parent 32d8b481e9
commit 2f8d330b57
3 changed files with 79 additions and 60 deletions

View File

@@ -266,6 +266,10 @@ def make_request_kwargs(
if base_headers:
headers.update(base_headers)
headers.update(args.headers)
if args.offline and args.chunked and 'Transfer-Encoding' not in headers:
# When online, we let requests set the header instead to be able more
# easily verify chunking is taking place.
headers['Transfer-Encoding'] = 'chunked'
headers = finalize_headers(headers)
if (args.form and files) or args.multipart: