From e244b63f872c3321fe9fbde325a1718dababef6d Mon Sep 17 00:00:00 2001 From: Sarper AVCI <50243344+sarperavci@users.noreply.github.com> Date: Wed, 5 Nov 2025 22:53:51 +0300 Subject: [PATCH] Fix Content-Type header update for non-empty data in set_curl_options --- curl_cffi/requests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curl_cffi/requests/utils.py b/curl_cffi/requests/utils.py index 67bcd3ad..5055bbdc 100644 --- a/curl_cffi/requests/utils.py +++ b/curl_cffi/requests/utils.py @@ -455,7 +455,7 @@ def set_curl_options( update_header_line( header_lines, "Content-Type", "application/x-www-form-urlencoded" ) - if isinstance(data, (str, bytes)): + if isinstance(data, (str, bytes)) and data: update_header_line(header_lines, "Content-Type", "application/octet-stream") # Never send `Expect` header.