aboutsummaryrefslogtreecommitdiff
path: root/src/web/web_server.rs
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-11-11 15:24:25 +0100
committerQuentin <quentin@deuxfleurs.fr>2020-11-11 15:24:25 +0100
commitd445c4ef9cd6835ec7e2e543e9e462adcd0f58bf (patch)
tree619f0ff58e501fda312b34e730a97b3121be4eac /src/web/web_server.rs
parent3cb3994cd2005231f8cc60ce02c55762a7b293f3 (diff)
downloadgarage-d445c4ef9cd6835ec7e2e543e9e462adcd0f58bf.tar.gz
garage-d445c4ef9cd6835ec7e2e543e9e462adcd0f58bf.zip
WIP fetch object
Diffstat (limited to 'src/web/web_server.rs')
-rw-r--r--src/web/web_server.rs7
1 files changed, 7 insertions, 0 deletions
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")))