mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00: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:
parent
a30d263522
commit
89da988da1
Notes:
sideshowbarker
2024-07-17 02:59:43 +09:00
Author: https://github.com/awesomekling
Commit: 89da988da1
3 changed files with 4 additions and 4 deletions
|
@ -1354,7 +1354,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
|
|||
if (!http_request->header_list()->contains("User-Agent"sv.bytes())) {
|
||||
auto header = Infrastructure::Header {
|
||||
.name = MUST(ByteBuffer::copy("User-Agent"sv.bytes())),
|
||||
.value = TRY_OR_THROW_OOM(vm, Infrastructure::default_user_agent_value()),
|
||||
.value = Infrastructure::default_user_agent_value(),
|
||||
};
|
||||
TRY_OR_THROW_OOM(vm, http_request->header_list()->append(move(header)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue