aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/get.rs
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2024-03-03 14:56:52 +0100
committerYureka <yuka@yuka.dev>2024-03-04 13:26:39 +0100
commitfb55682c66092921f766f82c16eb9e046f1bbb41 (patch)
tree744ae13518aa4e3f8cc572fb5c94a2bc19941818 /src/api/s3/get.rs
parent32d6b4def8d14d77727be9af640b1626d5153c75 (diff)
downloadgarage-fb55682c66092921f766f82c16eb9e046f1bbb41.tar.gz
garage-fb55682c66092921f766f82c16eb9e046f1bbb41.zip
add request context helper
Diffstat (limited to 'src/api/s3/get.rs')
-rw-r--r--src/api/s3/get.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/api/s3/get.rs b/src/api/s3/get.rs
index 0d18e775..ed996fb1 100644
--- a/src/api/s3/get.rs
+++ b/src/api/s3/get.rs
@@ -131,6 +131,16 @@ fn try_answer_cached(
/// Handle HEAD request
pub async fn handle_head(
+ ctx: ReqCtx,
+ req: &Request<impl Body>,
+ key: &str,
+ part_number: Option<u64>,
+) -> Result<Response<ResBody>, Error> {
+ handle_head_without_ctx(ctx.garage, req, ctx.bucket_id, key, part_number).await
+}
+
+/// Handle HEAD request for website
+pub async fn handle_head_without_ctx(
garage: Arc<Garage>,
req: &Request<impl Body>,
bucket_id: Uuid,
@@ -218,6 +228,17 @@ pub async fn handle_head(
/// Handle GET request
pub async fn handle_get(
+ ctx: ReqCtx,
+ req: &Request<impl Body>,
+ key: &str,
+ part_number: Option<u64>,
+ overrides: GetObjectOverrides,
+) -> Result<Response<ResBody>, Error> {
+ handle_get_without_ctx(ctx.garage, req, ctx.bucket_id, key, part_number, overrides).await
+}
+
+/// Handle GET request
+pub async fn handle_get_without_ctx(
garage: Arc<Garage>,
req: &Request<impl Body>,
bucket_id: Uuid,