From e557602d34eb453e3dce15c46b1956388f5cf53c Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Tue, 28 Feb 2023 18:48:59 +0000 Subject: [PATCH] LibWeb: Fully read body if there is one in fetch response handover Required by XHR's reliance on Fetch. --- Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp index 9d1d32222e..d95438b5ab 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp @@ -648,11 +648,10 @@ WebIDL::ExceptionOr fetch_response_handover(JS::Realm& realm, Infrastructu process_body({}); }); } - // FIXME: 4. Otherwise, fully read response’s body given processBody, processBodyError, and fetchParams’s task - // destination. + // 4. Otherwise, fully read response’s body given processBody, processBodyError, and fetchParams’s task + // destination. else { - // NOTE: This branch is not taken for JS fetch(), which supplies no 'process response consume body' function. - (void)process_body_error; + TRY(response.body()->fully_read(realm, move(process_body), move(process_body_error), fetch_params.task_destination())); } }