mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Let LoadRequest::set_body() take by value
This changes the signature of LoadRequest::set_body() to take by value and then use move semantics to move the contents of the ByteBuffer. This is done to avoid the fallible copy constructor of ByteBuffer.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
7831e62955
commit
f09e256328
Notes:
sideshowbarker
2024-07-17 05:43:42 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/f09e256328 Pull-request: https://github.com/SerenityOS/serenity/pull/15620 Reviewed-by: https://github.com/linusg ✅
@@ -128,7 +128,7 @@ void HTMLFormElement::submit_form(JS::GCPtr<HTMLElement> submitter, bool from_su
|
||||
auto body = url_encode(parameters, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded).to_byte_buffer();
|
||||
request.set_method("POST");
|
||||
request.set_header("Content-Type", "application/x-www-form-urlencoded");
|
||||
request.set_body(body);
|
||||
request.set_body(move(body));
|
||||
}
|
||||
|
||||
if (auto* page = document().page())
|
||||
|
||||
Reference in New Issue
Block a user