diff options
author | Linus Groh <mail@linusgroh.de> | 2022-11-04 21:20:46 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-11-04 22:35:45 +0000 |
commit | 6cd57d4c15e364f8cf9edfaa817eea7a759f3a5f (patch) | |
tree | 0ac387eb084ba4ce45552793edd8b4ef77d36539 /Userland/Libraries/LibWeb/Fetch/Request.cpp | |
parent | 71228a8d865f4610d5f62ca7065ea85f01477a36 (diff) | |
download | serenity-6cd57d4c15e364f8cf9edfaa817eea7a759f3a5f.zip |
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>
Diffstat (limited to 'Userland/Libraries/LibWeb/Fetch/Request.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/Request.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/Request.cpp b/Userland/Libraries/LibWeb/Fetch/Request.cpp index 8c15539835..ea33c6bfd2 100644 --- a/Userland/Libraries/LibWeb/Fetch/Request.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Request.cpp @@ -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); |