File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff 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 ));
You can’t perform that action at this time.
0 commit comments