From d445c4ef9cd6835ec7e2e543e9e462adcd0f58bf Mon Sep 17 00:00:00 2001 From: Quentin Date: Wed, 11 Nov 2020 15:24:25 +0100 Subject: WIP fetch object --- src/web/web_server.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/web') diff --git a/src/web/web_server.rs b/src/web/web_server.rs index 2440857d..cbb2aaac 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -57,6 +57,13 @@ async fn handler( let path = req.uri().path().to_string(); let key = percent_encoding::percent_decode_str(&path).decode_utf8()?; + // Get bucket descriptor + let object = garage + .object_table + .get(&bucket.to_string(), &key.to_string()) + .await? + .ok_or(Error::NotFound)?; + info!("Selected bucket: \"{}\", selected key: \"{}\"", bucket, key); Ok(Response::new(Body::from("hello world\n"))) -- cgit v1.2.3