浏览代码

LibWeb: Fully read body if there is one in fetch response handover

Required by XHR's reliance on Fetch.
Luke Wilde 2 年之前
父节点
当前提交
e557602d34
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp

+ 3 - 4
Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp

@@ -648,11 +648,10 @@ WebIDL::ExceptionOr<void> 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()));
         }
     }