mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibWeb: Properly copy method and headers from the input in Request()
We were accidentally copying these from the newly created Request object's underlying request, to itself. Thanks to Lubrsi for catching this! Co-authored-by: Luke Wilde <lukew@serenityos.org>
This commit is contained in:
parent
71228a8d86
commit
6cd57d4c15
Notes:
sideshowbarker
2024-07-17 04:47:24 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/6cd57d4c15 Pull-request: https://github.com/SerenityOS/serenity/pull/15928 Reviewed-by: https://github.com/Lubrsi ✅
|
@ -174,12 +174,12 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
|
|||
|
||||
// method
|
||||
// request’s method.
|
||||
request->set_method(TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(request->method())));
|
||||
request->set_method(TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(input_request->method())));
|
||||
|
||||
// header list
|
||||
// A copy of request’s header list.
|
||||
auto header_list_copy = Infrastructure::HeaderList::create(vm);
|
||||
for (auto& header : *request->header_list())
|
||||
for (auto& header : *input_request->header_list())
|
||||
TRY_OR_RETURN_OOM(realm, header_list_copy->append(header));
|
||||
request->set_header_list(header_list_copy);
|
||||
|
||||
|
|
Loading…
Reference in a new issue