RequestServer: Clarify comment for removing Content-Type header
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This comment assumed that the reader knew how curl behaved with empty
header values.
This commit is contained in:
rmg-x 2025-08-09 11:49:24 -05:00 committed by Tim Flynn
commit d489e46448
Notes: github-actions[bot] 2025-08-13 10:31:56 +00:00

View file

@ -536,7 +536,7 @@ void ConnectionFromClient::start_request(i32 request_id, ByteString method, URL:
struct curl_slist* curl_headers = nullptr;
// NOTE: CURLOPT_POSTFIELDS automatically sets the Content-Type header.
// Set it to empty if the headers passed in don't contain a content type.
// Tell curl to remove it by setting a blank value if the headers passed in don't contain a content type.
if (did_set_body && !request_headers.contains("Content-Type"))
curl_headers = curl_slist_append(curl_headers, "Content-Type:");