mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +00:00
use page's headerForRequest with fetch and XHR
This commit is contained in:
@@ -64,7 +64,7 @@ pub fn init(input: Input, options: ?InitOpts, page: *Page) !js.Promise {
|
||||
if (request._headers) |h| {
|
||||
try h.populateHttpHeader(page.call_arena, &headers);
|
||||
}
|
||||
try page.requestCookie(.{}).headersForRequest(page.arena, request._url, &headers);
|
||||
try page.headersForRequest(page.arena, request._url, &headers);
|
||||
|
||||
if (comptime IS_DEBUG) {
|
||||
log.debug(.http, "fetch", .{ .url = request._url });
|
||||
|
||||
@@ -197,7 +197,7 @@ pub fn send(self: *XMLHttpRequest, body_: ?[]const u8) !void {
|
||||
const http_client = page._session.browser.http_client;
|
||||
var headers = try http_client.newHeaders();
|
||||
try self._request_headers.populateHttpHeader(page.call_arena, &headers);
|
||||
try page.requestCookie(.{}).headersForRequest(self._arena, self._url, &headers);
|
||||
try page.headersForRequest(self._arena, self._url, &headers);
|
||||
|
||||
try http_client.request(.{
|
||||
.ctx = self,
|
||||
|
||||
Reference in New Issue
Block a user