From ec5988d56baff6030fcf791c9ff8c3ae1b6e4918 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 26 Apr 2024 14:14:18 -0400 Subject: [PATCH] LibWeb: Mark the task in the success steps of reading a body as mutable Otherwise, the `move(bytes_copy)` in the body of the steps does not actually act as a `move`. --- Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp index c0b7949ced7..1363fb32c28 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp @@ -75,7 +75,7 @@ WebIDL::ExceptionOr Body::fully_read(JS::Realm& realm, Web::Fetch::Infrast auto success_steps = [&realm, process_body, task_destination_object = task_destination_object](ByteBuffer const& bytes) mutable -> ErrorOr { // Make a copy of the bytes, as the source of the bytes may disappear between the time the task is queued and executed. auto bytes_copy = TRY(ByteBuffer::copy(bytes)); - queue_fetch_task(*task_destination_object, JS::create_heap_function(realm.heap(), [process_body, bytes_copy = move(bytes_copy)]() { + queue_fetch_task(*task_destination_object, JS::create_heap_function(realm.heap(), [process_body, bytes_copy = move(bytes_copy)]() mutable { process_body->function()(move(bytes_copy)); })); return {};