File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -816,6 +816,11 @@ impl Client {
816
816
axum:: http:: HeaderValue :: from_str ( & DEVICE_TYPE . to_string ( ) )
817
817
. unwrap ( ) ,
818
818
) ;
819
+ let user_agent = format ! (
820
+ "{}/{}" ,
821
+ env!( "CARGO_PKG_NAME" ) ,
822
+ env!( "CARGO_PKG_VERSION" )
823
+ ) ;
819
824
if let Some ( client_cert_path) = self . client_cert_path . as_ref ( ) {
820
825
let mut buf = Vec :: new ( ) ;
821
826
let mut f = tokio:: fs:: File :: open ( client_cert_path)
@@ -833,22 +838,14 @@ impl Client {
833
838
let pem = reqwest:: Identity :: from_pem ( & buf)
834
839
. map_err ( |e| Error :: CreateReqwestClient { source : e } ) ?;
835
840
Ok ( reqwest:: Client :: builder ( )
836
- . user_agent ( format ! (
837
- "{}/{}" ,
838
- env!( "CARGO_PKG_NAME" ) ,
839
- env!( "CARGO_PKG_VERSION" )
840
- ) )
841
+ . user_agent ( user_agent)
841
842
. identity ( pem)
842
843
. default_headers ( default_headers)
843
844
. build ( )
844
845
. map_err ( |e| Error :: CreateReqwestClient { source : e } ) ?)
845
846
} else {
846
847
Ok ( reqwest:: Client :: builder ( )
847
- . user_agent ( format ! (
848
- "{}/{}" ,
849
- env!( "CARGO_PKG_NAME" ) ,
850
- env!( "CARGO_PKG_VERSION" )
851
- ) )
848
+ . user_agent ( user_agent)
852
849
. default_headers ( default_headers)
853
850
. build ( )
854
851
. map_err ( |e| Error :: CreateReqwestClient { source : e } ) ?)
You can’t perform that action at this time.
0 commit comments