Skip to content

Commit b72e4ec

Browse files
committed
Fix #1665: Handle long strings with spaces from CLI
1 parent 5b604c3 commit b72e4ec

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

httpie/uploads.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,8 @@ def compress_request(
267267
request.body = deflated_data
268268
request.headers['Content-Encoding'] = 'deflate'
269269
request.headers['Content-Length'] = str(len(deflated_data))
270+
content_type = request.headers.get('Content-Type') or b''
271+
if isinstance(content_type, str):
272+
content_type = content_type.encode()
273+
if b'application/x-www-form-urlencoded' in content_type:
274+
request.headers['Content-Type'] = b'multipart/form-data; boundary=httpie'

0 commit comments

Comments
 (0)