mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue