From 792efb0c9f2e76eb125e654ee1495c071e57e02f Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Tue, 9 May 2023 10:56:08 +0300 Subject: [PATCH] fix: correct paths --- src/handlers/data.rs | 2 +- src/handlers/share.rs | 4 ++-- src/state.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/handlers/data.rs b/src/handlers/data.rs index 515ecb1..5d7ef44 100644 --- a/src/handlers/data.rs +++ b/src/handlers/data.rs @@ -59,7 +59,7 @@ pub(crate) async fn http( "proxying request to {}:{} with headers {:?}", app.musikcubed_address, app.musikcubed_http_port, - req.headers() + request.headers() ); app.make_musikcubed_request(format!("{path}{query_prefix}{query}"), request) diff --git a/src/handlers/share.rs b/src/handlers/share.rs index 590bcbd..481b390 100644 --- a/src/handlers/share.rs +++ b/src/handlers/share.rs @@ -44,7 +44,7 @@ pub(crate) async fn get_scoped_music_thumbnail( return Err("music id not found".into()); }; app.make_musikcubed_request( - format!("thumbnail/{}", info.thumbnail_id), + format!("/thumbnail/{}", info.thumbnail_id), Request::new(Body::empty()), ) .await @@ -62,7 +62,7 @@ pub(crate) async fn get_scoped_music_file( req.headers_mut().insert(RANGE, range); } let mut resp = app - .make_musikcubed_request(format!("audio/external_id/{music_id}"), req) + .make_musikcubed_request(format!("/audio/external_id/{music_id}"), req) .await?; if resp.status().is_success() { // add cache header diff --git a/src/state.rs b/src/state.rs index c746177..548d74b 100644 --- a/src/state.rs +++ b/src/state.rs @@ -107,7 +107,7 @@ impl AppStateInternal { mut req: http::Request, ) -> Result, AppError> { *req.uri_mut() = format!( - "http://{}:{}/{}", + "http://{}:{}{}", self.musikcubed_address, self.musikcubed_http_port, path.as_ref()