Skip to content

Commit

Permalink
Fix nested key bug
Browse files Browse the repository at this point in the history
Signed-off-by: avichalp <[email protected]>
  • Loading branch information
avichalp committed Jun 11, 2024
1 parent e6a57e7 commit 526697f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fendermint/app/src/cmd/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ cmd! {
.and(warp::multipart::form().max_length(MAX_OBJECT_LENGTH))
.and_then(handle_object_upload);

let objects_download = warp::path!("v1" / "objects" / Address / String)
let objects_download = warp::path!("v1" / "objects" / Address / ..)
.and(warp::path::tail())
.and(
warp::get().map(|| "GET".to_string()).or(warp::head().map(|| "HEAD".to_string())).unify()

Expand Down Expand Up @@ -613,7 +614,7 @@ struct ObjectRange {
#[allow(clippy::too_many_arguments)]
async fn handle_object_download(
address: Address,
key: String,
tail: Tail,
method: String,
range: Option<String>,
height_query: HeightQuery,
Expand All @@ -624,6 +625,8 @@ async fn handle_object_download(
let height = height_query
.height
.unwrap_or(FvmQueryHeight::Committed.into());
let path = tail.as_str();
let key: Vec<u8> = path.into();
let maybe_object = os_get(client, args, address, GetParams { key: key.into() }, height)
.await
.map_err(|e| {
Expand Down

0 comments on commit 526697f

Please sign in to comment.