Skip to content

Commit dfde525

Browse files
authored
Fix Content-Type header update for non-empty data in set_curl_options (#658)
1 parent f3122db commit dfde525

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

curl_cffi/requests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def set_curl_options(
455455
update_header_line(
456456
header_lines, "Content-Type", "application/x-www-form-urlencoded"
457457
)
458-
if isinstance(data, (str, bytes)):
458+
if isinstance(data, (str, bytes)) and data:
459459
update_header_line(header_lines, "Content-Type", "application/octet-stream")
460460

461461
# Never send `Expect` header.

0 commit comments

Comments
 (0)