Skip to content

Truly independent web browser

LibWeb: Keep a fetch body's bytes apart from its GC view

Shannon Booth237002f578e2
diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt
index 02c5dabd2dc..8e57ee03740 100644
--- a/Libraries/LibWeb/CMakeLists.txt
+++ b/Libraries/LibWeb/CMakeLists.txt
@@ -301,6 +301,7 @@ set(SOURCES
Fetch/Infrastructure/HTTP.cpp
Fetch/Infrastructure/HTTP/Bodies.cpp
Fetch/Infrastructure/HTTP/CORS.cpp
+ Fetch/Infrastructure/HTTP/FetchBody.cpp
Fetch/Infrastructure/HTTP/MIME.cpp
Fetch/Infrastructure/HTTP/Requests.cpp
Fetch/Infrastructure/HTTP/Responses.cpp
diff --git a/Libraries/LibWeb/CSS/FontFaceState.h b/Libraries/LibWeb/CSS/FontFaceState.h
index b4c2ca08101..9c2d80799be 100644
--- a/Libraries/LibWeb/CSS/FontFaceState.h
+++ b/Libraries/LibWeb/CSS/FontFaceState.h
@@ -26,6 +26,7 @@
#include <LibWeb/CSS/RustDescriptorBlock.h>
#include <LibWeb/CSS/StyleValues/ComputationContext.h>
#include <LibWeb/WebIDL/Buffers.h>
+#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::CSS {
diff --git a/Libraries/LibWeb/DOM/DocumentLoading.cpp b/Libraries/LibWeb/DOM/DocumentLoading.cpp
index 274a87ce633..181b474f5c9 100644
--- a/Libraries/LibWeb/DOM/DocumentLoading.cpp
+++ b/Libraries/LibWeb/DOM/DocumentLoading.cpp
@@ -25,6 +25,7 @@
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/DocumentLoading.h>
#include <LibWeb/DOM/IDLEventListener.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/MIME.h>
#include <LibWeb/Fetch/Response.h>
#include <LibWeb/HTML/BrowsingContext.h>
diff --git a/Libraries/LibWeb/Fetch/FetchMethod.cpp b/Libraries/LibWeb/Fetch/FetchMethod.cpp
index eb9e58409cf..188c1d70836 100644
--- a/Libraries/LibWeb/Fetch/FetchMethod.cpp
+++ b/Libraries/LibWeb/Fetch/FetchMethod.cpp
@@ -17,6 +17,7 @@
#include <LibWeb/Fetch/Fetching/RefCountedFlag.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
#include <LibWeb/Fetch/Request.h>
diff --git a/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp
index f1aba85aa2f..33b0872c525 100644
--- a/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp
+++ b/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp
@@ -1585,7 +1585,7 @@ GC::Ref<PendingResponse> scheme_fetch(JS::Realm& realm, Infrastructure::FetchPar
response->set_status_message("OK"sv);
// 3. Set response’s body to bodyWithType’s body.
- response->set_body(Infrastructure::ResponseBody::from_extracted_body(body_with_type.body));
+ response->set_body(Infrastructure::ResponseBody::from_fetch_body(body_with_type.body->fetch_body()));
// 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ».
auto content_length_header = HTTP::Header::isomorphic_encode("Content-Length"sv, serialized_full_length);
@@ -1640,7 +1640,7 @@ GC::Ref<PendingResponse> scheme_fetch(JS::Realm& realm, Infrastructure::FetchPar
auto sliced_body_with_type = safely_extract_body(realm, sliced_blob->raw_bytes());
// 10. Set response’s body to slicedBodyWithType’s body.
- response->set_body(Infrastructure::ResponseBody::from_extracted_body(sliced_body_with_type.body));
+ response->set_body(Infrastructure::ResponseBody::from_fetch_body(sliced_body_with_type.body->fetch_body()));
// 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded.
auto serialized_sliced_length = String::number(sliced_blob->size());
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp
index ff1f4c798ee..78d60cdad22 100644
--- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.cpp
@@ -27,38 +27,6 @@ bool web_fetch_body_length(Body*, u64* out_length);
GC_DEFINE_ALLOCATOR(Body);
-FetchBody::FetchBody(Optional<Core::ImmutableBytes> source, Optional<u64> length)
- : m_source(move(source))
- , m_length(length)
-{
-}
-
-ResponseBody::ResponseBody(Bytes bytes, Optional<u64> length)
- : m_bytes(move(bytes))
- , m_length(length)
-{
-}
-
-ResponseBody ResponseBody::from_bytes(Core::ImmutableBytes bytes)
-{
- auto length = bytes.size();
- return ResponseBody { move(bytes), length };
-}
-
-ResponseBody ResponseBody::from_extracted_body(Body const& body)
-{
- if (auto const& source = body.source(); source.has_value())
- return ResponseBody { *source, body.length() };
- return ResponseBody { ReadThroughStream {}, body.length() };
-}
-
-Optional<Core::ImmutableBytes const&> ResponseBody::source() const
-{
- if (auto const* bytes = m_bytes.get_pointer<Core::ImmutableBytes>())
- return *bytes;
- return {};
-}
-
GC::Ref<Body> Body::create(GC::Ref<Streams::ReadableStream> stream, FetchBody fetch_body)
{
return GC::Heap::the().allocate<Body>(stream, move(fetch_body), NeverSniffed {});
@@ -229,13 +197,6 @@ GC::Ref<Body> byte_sequence_as_body(JS::Realm& realm, ReadonlyBytes bytes)
return body;
}
-// https://fetch.spec.whatwg.org/#byte-sequence-as-a-body
-// NB: Each view of the body makes its stream from these bytes.
-ResponseBody byte_sequence_as_response_body(ReadonlyBytes bytes)
-{
- return ResponseBody::from_bytes(MUST(Core::ImmutableBytes::copy(bytes)));
-}
-
void cancel_incremental_read(Streams::ReadableStreamDefaultReader& reader)
{
reader.cancel({});
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.h b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.h
index 17c437666f5..08ced24b509 100644
--- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.h
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Bodies.h
@@ -8,7 +8,6 @@
#include <AK/ByteBuffer.h>
#include <AK/Forward.h>
-#include <AK/NonnullRefPtr.h>
#include <AK/Optional.h>
#include <AK/Utf16String.h>
#include <AK/Variant.h>
@@ -16,7 +15,7 @@
#include <LibGC/Ptr.h>
#include <LibGC/Root.h>
#include <LibWeb/Export.h>
-#include <LibWeb/Fetch/Engine/FetchByteChannel.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/FetchBody.h>
#include <LibWeb/Fetch/Infrastructure/Task.h>
#include <LibWeb/Streams/ReadableStream.h>
#include <LibWeb/WebIDL/Promise.h>
@@ -26,57 +25,6 @@ namespace Web::Fetch::Infrastructure {
// https://mimesniff.spec.whatwg.org/#reading-the-resource-header
static constexpr size_t MAX_SNIFF_BYTES = 1445;
-// A body's source and length, without its stream.
-class WEB_API FetchBody {
-public:
- FetchBody() = default;
- FetchBody(Optional<Core::ImmutableBytes> source, Optional<u64> length);
-
- [[nodiscard]] static FetchBody from_bytes(Core::ImmutableBytes bytes)
- {
- auto length = bytes.size();
- return FetchBody { move(bytes), length };
- }
-
- [[nodiscard]] Optional<Core::ImmutableBytes> const& source() const { return m_source; }
- [[nodiscard]] Optional<u64> const& length() const { return m_length; }
-
-private:
- // https://fetch.spec.whatwg.org/#concept-body-source
- // A source (null, a byte sequence, a Blob object, or a FormData object), initially null.
- // NB: A Blob or FormData source is held as its bytes.
- Optional<Core::ImmutableBytes> m_source;
-
- // https://fetch.spec.whatwg.org/#concept-body-total-bytes
- // A length (null or an integer), initially null.
- Optional<u64> m_length;
-};
-
-// A response's body as fetch keeps it: its length and where its bytes are.
-class WEB_API ResponseBody {
-public:
- // The bytes are read through the stream of the response's body view.
- struct ReadThroughStream { };
- using Bytes = Variant<Core::ImmutableBytes, NonnullRefPtr<Engine::FetchByteChannel>, ReadThroughStream>;
-
- ResponseBody(Bytes, Optional<u64> length);
-
- [[nodiscard]] static ResponseBody from_bytes(Core::ImmutableBytes);
- [[nodiscard]] static ResponseBody from_extracted_body(Body const&);
-
- [[nodiscard]] Bytes const& bytes() const { return m_bytes; }
-
- // https://fetch.spec.whatwg.org/#concept-body-source
- [[nodiscard]] Optional<Core::ImmutableBytes const&> source() const;
-
- // https://fetch.spec.whatwg.org/#concept-body-total-bytes
- [[nodiscard]] Optional<u64> const& length() const { return m_length; }
-
-private:
- Bytes m_bytes;
- Optional<u64> m_length;
-};
-
// https://fetch.spec.whatwg.org/#concept-body
class WEB_API Body final : public JS::Cell {
GC_CELL(Body, JS::Cell);
@@ -165,7 +113,6 @@ struct BodyWithType {
};
WEB_API GC::Ref<Body> byte_sequence_as_body(JS::Realm&, ReadonlyBytes);
-WEB_API ResponseBody byte_sequence_as_response_body(ReadonlyBytes);
WEB_API void cancel_incremental_read(Streams::ReadableStreamDefaultReader&);
}
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/FetchBody.cpp b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/FetchBody.cpp
new file mode 100644
index 00000000000..8f4ac1363b1
--- /dev/null
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/FetchBody.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2026-present, the Ladybird developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibWeb/Fetch/Infrastructure/HTTP/FetchBody.h>
+
+namespace Web::Fetch::Infrastructure {
+
+FetchBody::FetchBody(Optional<Core::ImmutableBytes> source, Optional<u64> length)
+ : m_source(move(source))
+ , m_length(length)
+{
+}
+
+ResponseBody::ResponseBody(Bytes bytes, Optional<u64> length)
+ : m_bytes(move(bytes))
+ , m_length(length)
+{
+}
+
+ResponseBody ResponseBody::from_bytes(Core::ImmutableBytes bytes)
+{
+ auto length = bytes.size();
+ return ResponseBody { move(bytes), length };
+}
+
+ResponseBody ResponseBody::from_fetch_body(FetchBody const& body)
+{
+ if (auto const& source = body.source(); source.has_value())
+ return ResponseBody { *source, body.length() };
+ return ResponseBody { ReadThroughStream {}, body.length() };
+}
+
+Optional<Core::ImmutableBytes const&> ResponseBody::source() const
+{
+ if (auto const* bytes = m_bytes.get_pointer<Core::ImmutableBytes>())
+ return *bytes;
+ return {};
+}
+
+// https://fetch.spec.whatwg.org/#byte-sequence-as-a-body
+// NB: Each view of the body makes its stream from these bytes.
+ResponseBody byte_sequence_as_response_body(ReadonlyBytes bytes)
+{
+ return ResponseBody::from_bytes(MUST(Core::ImmutableBytes::copy(bytes)));
+}
+
+}
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/FetchBody.h b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/FetchBody.h
new file mode 100644
index 00000000000..32687cd5042
--- /dev/null
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/FetchBody.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2026-present, the Ladybird developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <AK/Forward.h>
+#include <AK/NonnullRefPtr.h>
+#include <AK/Optional.h>
+#include <AK/Variant.h>
+#include <LibCore/ImmutableBytes.h>
+#include <LibWeb/Export.h>
+#include <LibWeb/Fetch/Engine/FetchByteChannel.h>
+
+namespace Web::Fetch::Infrastructure {
+
+// A body's source and length, without its stream.
+class WEB_API FetchBody {
+public:
+ FetchBody() = default;
+ FetchBody(Optional<Core::ImmutableBytes> source, Optional<u64> length);
+
+ [[nodiscard]] static FetchBody from_bytes(Core::ImmutableBytes bytes)
+ {
+ auto length = bytes.size();
+ return FetchBody { move(bytes), length };
+ }
+
+ [[nodiscard]] Optional<Core::ImmutableBytes> const& source() const { return m_source; }
+ [[nodiscard]] Optional<u64> const& length() const { return m_length; }
+
+private:
+ // https://fetch.spec.whatwg.org/#concept-body-source
+ // A source (null, a byte sequence, a Blob object, or a FormData object), initially null.
+ // NB: A Blob or FormData source is held as its bytes.
+ Optional<Core::ImmutableBytes> m_source;
+
+ // https://fetch.spec.whatwg.org/#concept-body-total-bytes
+ // A length (null or an integer), initially null.
+ Optional<u64> m_length;
+};
+
+// A response's body as fetch keeps it: its length and where its bytes are.
+class WEB_API ResponseBody {
+public:
+ // The bytes are read through the stream of the response's body view.
+ struct ReadThroughStream { };
+ using Bytes = Variant<Core::ImmutableBytes, NonnullRefPtr<Engine::FetchByteChannel>, ReadThroughStream>;
+
+ ResponseBody(Bytes, Optional<u64> length);
+
+ [[nodiscard]] static ResponseBody from_bytes(Core::ImmutableBytes);
+ [[nodiscard]] static ResponseBody from_fetch_body(FetchBody const&);
+
+ [[nodiscard]] Bytes const& bytes() const { return m_bytes; }
+
+ // https://fetch.spec.whatwg.org/#concept-body-source
+ [[nodiscard]] Optional<Core::ImmutableBytes const&> source() const;
+
+ // https://fetch.spec.whatwg.org/#concept-body-total-bytes
+ [[nodiscard]] Optional<u64> const& length() const { return m_length; }
+
+private:
+ Bytes m_bytes;
+ Optional<u64> m_length;
+};
+
+WEB_API ResponseBody byte_sequence_as_response_body(ReadonlyBytes);
+
+}
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h
index 5a21a7183ad..26144725f08 100644
--- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Requests.h
@@ -29,7 +29,7 @@
#include <LibWeb/Export.h>
#include <LibWeb/Fetch/Infrastructure/ClientContextSnapshot.h>
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
-#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/FetchBody.h>
#include <LibWeb/Fetch/Infrastructure/KeepaliveQuotaAccountant.h>
#include <LibWeb/Fetch/Infrastructure/NetworkObservation.h>
#include <LibWeb/HTML/Scripting/EnvironmentSettingsObjectAddress.h>
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/ResponseView.cpp b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/ResponseView.cpp
index bbe6e6be0c3..34ee13086c6 100644
--- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/ResponseView.cpp
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/ResponseView.cpp
@@ -6,6 +6,7 @@
#include <LibGC/Heap.h>
#include <LibHTTP/HeaderList.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/MIME.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
diff --git a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h
index a5832995d90..a5b23d9142a 100644
--- a/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h
+++ b/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h
@@ -23,7 +23,7 @@
#include <LibWeb/Fetch/Engine/FetchBodyDeliveryGate.h>
#include <LibWeb/Fetch/Engine/NetworkTransportHandle.h>
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
-#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/FetchBody.h>
#include <LibWebCommon/Fetch/Infrastructure/HTTP/ResponseCacheState.h>
#include <LibWebCommon/Fetch/Infrastructure/HTTP/Statuses.h>
diff --git a/Libraries/LibWeb/Fetch/Response.cpp b/Libraries/LibWeb/Fetch/Response.cpp
index fb895277df8..3e3ef5c0322 100644
--- a/Libraries/LibWeb/Fetch/Response.cpp
+++ b/Libraries/LibWeb/Fetch/Response.cpp
@@ -132,7 +132,7 @@ WebIDL::ExceptionOr<GC::Ref<Response>> Response::create_with_body(ResponseInit c
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, "Response with null body status cannot have a body"_utf16 };
// 2. Set response’s body to body’s body.
- response->set_body(Infrastructure::ResponseBody::from_extracted_body(body->body));
+ response->set_body(Infrastructure::ResponseBody::from_fetch_body(body->body->fetch_body()));
// 3. If body’s type is non-null and response’s header list does not contain `Content-Type`, then append (`Content-Type`, body’s type) to response’s header list.
if (body->type.has_value() && !response->header_list()->contains("Content-Type"sv))
diff --git a/Libraries/LibWeb/HTML/EventSource.cpp b/Libraries/LibWeb/HTML/EventSource.cpp
index d6f0efb4fef..7f855e1485d 100644
--- a/Libraries/LibWeb/HTML/EventSource.cpp
+++ b/Libraries/LibWeb/HTML/EventSource.cpp
@@ -15,6 +15,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/MIME.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
diff --git a/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Libraries/LibWeb/HTML/HTMLLinkElement.cpp
index 22790693c62..b6b1662f5cc 100644
--- a/Libraries/LibWeb/HTML/HTMLLinkElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLLinkElement.cpp
@@ -31,6 +31,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/MIME.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
diff --git a/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
index 15448ed093c..31883e52cea 100644
--- a/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
@@ -32,6 +32,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
#include <LibWeb/FileAPI/BlobURLStore.h>
diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
index 31446ca0b6d..b91c986ca43 100644
--- a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp
@@ -21,6 +21,7 @@
#include <LibWeb/DOM/Event.h>
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/MIME.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
diff --git a/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Libraries/LibWeb/HTML/HTMLVideoElement.cpp
index c7555567301..8410b55bc45 100644
--- a/Libraries/LibWeb/HTML/HTMLVideoElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLVideoElement.cpp
@@ -21,6 +21,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
#include <LibWeb/HTML/AudioTrackList.h>
diff --git a/Libraries/LibWeb/HTML/LocalNavigable.cpp b/Libraries/LibWeb/HTML/LocalNavigable.cpp
index 76bbf116af3..5458adfa749 100644
--- a/Libraries/LibWeb/HTML/LocalNavigable.cpp
+++ b/Libraries/LibWeb/HTML/LocalNavigable.cpp
@@ -47,6 +47,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
#include <LibWeb/HTML/BrowsingContext.h>
diff --git a/Libraries/LibWeb/HTML/SharedResourceRequest.cpp b/Libraries/LibWeb/HTML/SharedResourceRequest.cpp
index 952773c2a0f..3923221814c 100644
--- a/Libraries/LibWeb/HTML/SharedResourceRequest.cpp
+++ b/Libraries/LibWeb/HTML/SharedResourceRequest.cpp
@@ -12,6 +12,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/MIME.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
diff --git a/Libraries/LibWeb/SVG/SVGResourceDocument.cpp b/Libraries/LibWeb/SVG/SVGResourceDocument.cpp
index 930a4cd51e7..36699e66e99 100644
--- a/Libraries/LibWeb/SVG/SVGResourceDocument.cpp
+++ b/Libraries/LibWeb/SVG/SVGResourceDocument.cpp
@@ -10,6 +10,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/ResponseView.h>
#include <LibWeb/HTML/Scripting/Environments.h>
diff --git a/Libraries/LibWeb/ServiceWorker/Cache.cpp b/Libraries/LibWeb/ServiceWorker/Cache.cpp
index d31bc35b080..ce495d37830 100644
--- a/Libraries/LibWeb/ServiceWorker/Cache.cpp
+++ b/Libraries/LibWeb/ServiceWorker/Cache.cpp
@@ -12,6 +12,7 @@
#include <LibWeb/Fetch/Fetching/ClientContextSnapshots.h>
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
+#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
#include <LibWeb/Fetch/Request.h>