send Accept header when navigating

This commit is contained in:
Halil Durak committed 2026-05-15 18:30:18 +03:00
1 parent 4f33d64c5c
commit 9c40cd9fb2
2 files changed
+4

No files matched your search

+3
View File
@@ -488,6 +488,9 @@ pub const HttpHeaders = struct {
// normal client.
pub const accept_language: [:0]const u8 = "Accept-Language: en-US,en;q=0.9";
// Document-navigation Accept value Chrome sends.
pub const navigation_accept: [:0]const u8 = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
user_agent: [:0]const u8, // User agent value (e.g. "Lightpanda/1.0")
user_agent_header: [:0]const u8,
+1
View File
@@ -621,6 +621,7 @@ pub fn navigate(self: *Frame, request_url: [:0]const u8, opts: NavigateOpts) !vo
};
var headers = try http_client.newHeaders();
try headers.add(lp.Config.HttpHeaders.navigation_accept);
if (opts.header) |hdr| {
try headers.add(hdr);
}