RequestServer: Don't set CURLOPT_HTTPGET _and_ CURLOPT_CUSTOMREQUEST
Some checks failed
CI / macOS, arm64, Sanitizer, Clang (push) Has been cancelled
CI / Linux, x86_64, Fuzzers, Clang (push) Has been cancelled
CI / Linux, x86_64, Sanitizer, GNU (push) Has been cancelled
CI / Linux, x86_64, Sanitizer, Clang (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Run test262 and test-wasm / run_and_update_results (push) Has been cancelled
Lint Code / lint (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Push notes / build (push) Has been cancelled

We always set CURLOPT_CUSTOMREQUEST, so we can skip setting
CURLOPT_HTTPGET.
This commit is contained in:
Jelle Raaijmakers 2025-08-13 12:42:42 +02:00 committed by Tim Flynn
commit 9080af4085
Notes: github-actions[bot] 2025-08-13 14:31:19 +00:00

View file

@ -516,21 +516,18 @@ void ConnectionFromClient::start_request(i32 request_id, ByteString method, URL:
set_option(CURLOPT_PIPEWAIT, 1L);
set_option(CURLOPT_ALTSVC, m_alt_svc_cache_path.characters());
bool did_set_body = false;
set_option(CURLOPT_CUSTOMREQUEST, method.characters());
set_option(CURLOPT_FOLLOWLOCATION, 0);
if (method == "GET"sv) {
set_option(CURLOPT_HTTPGET, 1L);
} else if (method.is_one_of("POST"sv, "PUT"sv, "PATCH"sv, "DELETE"sv)) {
bool did_set_body = false;
if (method.is_one_of("POST"sv, "PUT"sv, "PATCH"sv, "DELETE"sv)) {
request->body = move(request_body);
set_option(CURLOPT_POSTFIELDSIZE, request->body.size());
set_option(CURLOPT_POSTFIELDS, request->body.data());
did_set_body = true;
} else if (method == "HEAD") {
} else if (method == "HEAD"sv) {
set_option(CURLOPT_NOBODY, 1L);
}
set_option(CURLOPT_CUSTOMREQUEST, method.characters());
set_option(CURLOPT_FOLLOWLOCATION, 0);
struct curl_slist* curl_headers = nullptr;