mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Honor User-Agent spoofing in Fetch headers
This makes spoofing consistent between legacy ResourceLoader loads, Fetch loads, and the JavaScript `navigator` APIs.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 02:59:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/89da988da1
@@ -882,10 +882,10 @@ Optional<RangeHeaderValue> parse_single_range_header_value(ReadonlyBytes value)
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#default-user-agent-value
|
||||
ErrorOr<ByteBuffer> default_user_agent_value()
|
||||
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());
|
||||
return MUST(ByteBuffer::copy(ResourceLoader::the().user_agent().bytes()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user