mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 18:08:12 +00:00
LibWeb: Make HeaderList ref-counted
This is needed to eventually share a header list between a Request or Response object's internal infra request/response and the object's exposed Header object.
This commit is contained in:
parent
2d57d47132
commit
afe2563e2b
8 changed files with 61 additions and 46 deletions
|
@ -9,6 +9,11 @@
|
|||
|
||||
namespace Web::Fetch::Infrastructure {
|
||||
|
||||
Request::Request()
|
||||
: m_header_list(make_ref_counted<HeaderList>())
|
||||
{
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-request-url
|
||||
AK::URL const& Request::url() const
|
||||
{
|
||||
|
@ -202,7 +207,7 @@ ErrorOr<void> Request::add_range_reader(u64 first, Optional<u64> const& last)
|
|||
.name = TRY(ByteBuffer::copy("Range"sv.bytes())),
|
||||
.value = move(range_value),
|
||||
};
|
||||
TRY(m_header_list.append(move(header)));
|
||||
TRY(m_header_list->append(move(header)));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue