File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,9 @@ use std::time::Duration;
2020
2121use anyhow:: anyhow;
2222use chrono:: { DateTime , Utc } ;
23+ use http:: header;
2324
24- use crate :: about;
25+ use crate :: { about, parseable :: PARSEABLE } ;
2526
2627use super :: uid;
2728
@@ -32,11 +33,19 @@ pub struct LatestRelease {
3233}
3334
3435pub async fn get_latest ( deployment_id : & uid:: Uid ) -> Result < LatestRelease , anyhow:: Error > {
36+ let send_analytics = PARSEABLE . options . send_analytics . to_string ( ) ;
37+ let mut headers = header:: HeaderMap :: new ( ) ;
38+ headers. insert (
39+ "P_SEND_ANONYMOUS_USAGE_DATA" ,
40+ header:: HeaderValue :: from_str ( send_analytics. as_str ( ) ) . expect ( "valid header value" ) ,
41+ ) ;
3542 let agent = reqwest:: ClientBuilder :: new ( )
3643 . user_agent ( about:: user_agent ( deployment_id) )
44+ . default_headers ( headers)
3745 . timeout ( Duration :: from_secs ( 8 ) )
3846 . build ( )
3947 . expect ( "client can be built on this system" ) ;
48+
4049 let json: serde_json:: Value = agent
4150 . get ( "https://download.parseable.io/latest-version" )
4251 . send ( )
You can’t perform that action at this time.
0 commit comments