mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb: Support sending DNT header with requests
This commit is contained in:
parent
830b287c46
commit
fb20326979
Notes:
sideshowbarker
2024-07-17 07:14:09 +09:00
Author: https://github.com/jamierocks
Commit: fb20326979
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/373
Reviewed-by: https://github.com/trflynn89
7 changed files with 22 additions and 0 deletions
|
@ -1689,6 +1689,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
|
|||
// NOTE: `Accept` and `Accept-Language` are already included (unless fetch() is used, which does not include
|
||||
// the latter by default), and `Accept-Charset` is a waste of bytes. See HTTP header layer division for
|
||||
// more details.
|
||||
if (ResourceLoader::the().enable_do_not_track() && !http_request->header_list()->contains("DNT"sv.bytes())) {
|
||||
auto header = Infrastructure::Header::from_string_pair("DNT"sv, "1"sv);
|
||||
http_request->header_list()->append(move(header));
|
||||
}
|
||||
|
||||
// 21. If includeCredentials is true, then:
|
||||
if (include_credentials == IncludeCredentials::Yes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue