@@ -11,8 +11,6 @@ use std::{
1111use thiserror:: Error ;
1212use tokio_util:: sync:: CancellationToken ;
1313
14- static COMMIT : Option < & ' static str > = option_env ! ( "GITHUB_SHA" ) ;
15-
1614#[ derive( Serialize , Debug ) ]
1715pub struct Report {
1816 size : usize ,
@@ -115,7 +113,7 @@ pub struct UsageAgent {
115113 processor : Arc < OperationProcessor > ,
116114 client : ClientWithMiddleware ,
117115 flush_interval : Duration ,
118- user_agent_prefix : String ,
116+ user_agent : String ,
119117}
120118
121119fn non_empty_string ( value : Option < String > ) -> Option < String > {
@@ -147,7 +145,7 @@ impl UsageAgent {
147145 request_timeout : u64 ,
148146 accept_invalid_certs : bool ,
149147 flush_interval : Duration ,
150- user_agent_prefix : String ,
148+ user_agent : String ,
151149 ) -> Self {
152150 let processor = Arc :: new ( OperationProcessor :: new ( ) ) ;
153151
@@ -181,7 +179,7 @@ impl UsageAgent {
181179 buffer_size,
182180 client,
183181 flush_interval,
184- user_agent_prefix ,
182+ user_agent ,
185183 }
186184 }
187185
@@ -278,10 +276,7 @@ impl UsageAgent {
278276 reqwest:: header:: AUTHORIZATION ,
279277 format ! ( "Bearer {}" , self . token) ,
280278 )
281- . header (
282- reqwest:: header:: USER_AGENT ,
283- format ! ( "{}/{}" , self . user_agent_prefix, COMMIT . unwrap_or( "local" ) ) ,
284- )
279+ . header ( reqwest:: header:: USER_AGENT , self . user_agent . to_string ( ) )
285280 . header ( reqwest:: header:: CONTENT_TYPE , "application/json" )
286281 . header ( reqwest:: header:: CONTENT_LENGTH , report_body. len ( ) )
287282 . body ( report_body)
0 commit comments