Skip to content

Commit e225ed9

Browse files
committed
fix for telemetry and one-off requests
1 parent 2655012 commit e225ed9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/http/Http.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ pub const Connection = struct {
112112

113113
const Opts = struct {
114114
proxy_bearer_token: ?[:0]const u8,
115+
user_agent: [:0]const u8,
115116
};
116117

117118
// pointer to opts is not stable, don't hold a reference to it!
@@ -172,6 +173,7 @@ pub const Connection = struct {
172173
return .{
173174
.easy = easy,
174175
.opts = .{
176+
.user_agent = opts.user_agent,
175177
.proxy_bearer_token = opts.proxy_bearer_token,
176178
},
177179
};
@@ -234,7 +236,7 @@ pub const Connection = struct {
234236
pub fn request(self: *const Connection) !u16 {
235237
const easy = self.easy;
236238

237-
var header_list = try Headers.init();
239+
var header_list = try Headers.init(self.opts.user_agent);
238240
defer header_list.deinit();
239241
try self.secretHeaders(&header_list);
240242
try errorCheck(c.curl_easy_setopt(easy, c.CURLOPT_HTTPHEADER, header_list.headers));

0 commit comments

Comments
 (0)