@@ -7,11 +7,11 @@ use crate::{
77 RemoteConfigProduct , Target ,
88} ;
99use base64:: Engine ;
10+ use http:: uri:: PathAndQuery ;
1011use http:: uri:: Scheme ;
12+ use http:: StatusCode ;
1113use http_body_util:: BodyExt ;
12- use hyper:: http:: uri:: PathAndQuery ;
13- use hyper:: StatusCode ;
14- use libdd_common:: { hyper_migration, Endpoint , MutexExt } ;
14+ use libdd_common:: { http_common, Endpoint , MutexExt } ;
1515use libdd_trace_protobuf:: remoteconfig:: {
1616 ClientGetConfigsRequest , ClientGetConfigsResponse , ClientState , ClientTracer , ConfigState ,
1717 TargetFileHash , TargetFileMeta ,
@@ -345,12 +345,10 @@ impl<S: FileStorage> ConfigFetcher<S> {
345345 http:: header:: CONTENT_TYPE ,
346346 libdd_common:: header:: APPLICATION_JSON ,
347347 )
348- . body ( hyper_migration:: Body :: from ( serde_json:: to_string (
349- & config_req,
350- ) ?) ) ?;
348+ . body ( http_common:: Body :: from ( serde_json:: to_string ( & config_req) ?) ) ?;
351349 let response = tokio:: time:: timeout (
352350 Duration :: from_millis ( self . state . endpoint . timeout_ms ) ,
353- hyper_migration :: new_default_client ( ) . request ( req) ,
351+ http_common :: new_default_client ( ) . request ( req) ,
354352 )
355353 . await
356354 . map_err ( |e| anyhow:: Error :: msg ( e) . context ( format ! ( "Url: {:?}" , self . state. endpoint) ) ) ?
@@ -567,7 +565,7 @@ fn get_product_endpoint(subdomain: &str, endpoint: &Endpoint) -> Endpoint {
567565 parts. path_and_query = Some ( PathAndQuery :: from_static ( "/v0.7/config" ) ) ;
568566 #[ allow( clippy:: unwrap_used) ]
569567 Endpoint {
570- url : hyper :: Uri :: from_parts ( parts) . unwrap ( ) ,
568+ url : http :: Uri :: from_parts ( parts) . unwrap ( ) ,
571569 api_key : endpoint. api_key . clone ( ) ,
572570 test_token : endpoint. test_token . clone ( ) ,
573571 ..* endpoint
@@ -682,7 +680,7 @@ pub mod tests {
682680 ) ;
683681 let mut opaque_state = ConfigClientState :: default ( ) ;
684682
685- let mut response = Response :: new ( hyper_migration :: Body :: from ( "" ) ) ;
683+ let mut response = http_common :: empty_response ( Response :: builder ( ) ) . unwrap ( ) ;
686684 * response. status_mut ( ) = StatusCode :: NOT_FOUND ;
687685 * server. next_response . lock ( ) . unwrap ( ) = Some ( response) ;
688686
0 commit comments