mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
fix for telemetry and one-off requests
This commit is contained in:
@@ -112,6 +112,7 @@ pub const Connection = struct {
|
|||||||
|
|
||||||
const Opts = struct {
|
const Opts = struct {
|
||||||
proxy_bearer_token: ?[:0]const u8,
|
proxy_bearer_token: ?[:0]const u8,
|
||||||
|
user_agent: [:0]const u8,
|
||||||
};
|
};
|
||||||
|
|
||||||
// pointer to opts is not stable, don't hold a reference to it!
|
// pointer to opts is not stable, don't hold a reference to it!
|
||||||
@@ -172,6 +173,7 @@ pub const Connection = struct {
|
|||||||
return .{
|
return .{
|
||||||
.easy = easy,
|
.easy = easy,
|
||||||
.opts = .{
|
.opts = .{
|
||||||
|
.user_agent = opts.user_agent,
|
||||||
.proxy_bearer_token = opts.proxy_bearer_token,
|
.proxy_bearer_token = opts.proxy_bearer_token,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -234,7 +236,7 @@ pub const Connection = struct {
|
|||||||
pub fn request(self: *const Connection) !u16 {
|
pub fn request(self: *const Connection) !u16 {
|
||||||
const easy = self.easy;
|
const easy = self.easy;
|
||||||
|
|
||||||
var header_list = try Headers.init();
|
var header_list = try Headers.init(self.opts.user_agent);
|
||||||
defer header_list.deinit();
|
defer header_list.deinit();
|
||||||
try self.secretHeaders(&header_list);
|
try self.secretHeaders(&header_list);
|
||||||
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_HTTPHEADER, header_list.headers));
|
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_HTTPHEADER, header_list.headers));
|
||||||
|
|||||||
Reference in New Issue
Block a user