LibWeb: Implement 'Default User-Agent value' AO

This commit is contained in:
Linus Groh 2022-10-24 09:23:18 +01:00
commit 6deb5ce9b5
Notes: sideshowbarker 2024-07-17 04:59:52 +09:00
3 changed files with 10 additions and 1 deletions

View file

@ -17,6 +17,7 @@
#include <LibWeb/Fetch/Infrastructure/HTTP.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Headers.h>
#include <LibWeb/Infra/ByteSequences.h>
#include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/MimeSniff/MimeType.h>
namespace Web::Fetch::Infrastructure {
@ -686,4 +687,11 @@ Optional<RangeHeaderValue> parse_single_range_header_value(ReadonlyBytes value)
return RangeHeaderValue { move(range_start_value), move(range_end_value) };
}
// https://fetch.spec.whatwg.org/#default-user-agent-value
ErrorOr<ByteBuffer> default_user_agent_value()
{
// A default `User-Agent` value is an implementation-defined header value for the `User-Agent` header.
return ByteBuffer::copy(default_user_agent.bytes());
}
}