mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 18:46:03 +00:00
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
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:
parent
ed57d2de98
commit
9080af4085
Notes:
github-actions[bot]
2025-08-13 14:31:19 +00:00
Author: https://github.com/gmta
Commit: 9080af4085
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5841
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 5 additions and 8 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue