[fix-presigned] presigned requests: allow x-amz-* query parameters to stand in for equivalent headers

This commit is contained in:
Alex Auvolat
2024-02-28 00:27:54 +01:00
parent a5e4bfeae9
commit e9f759d4cb
4 changed files with 44 additions and 13 deletions
+3 -2
View File
@@ -69,7 +69,7 @@ impl ApiHandler for K2VApiServer {
async fn handle(
&self,
req: Request<IncomingBody>,
mut req: Request<IncomingBody>,
endpoint: K2VApiEndpoint,
) -> Result<Response<ResBody>, Error> {
let K2VApiEndpoint {
@@ -86,7 +86,8 @@ impl ApiHandler for K2VApiServer {
return Ok(options_res.map(|_empty_body: EmptyBody| empty_body()));
}
let (api_key, mut content_sha256) = check_payload_signature(&garage, "k2v", &req).await?;
let (api_key, mut content_sha256) =
check_payload_signature(&garage, "k2v", &mut req).await?;
let api_key = api_key
.ok_or_else(|| Error::forbidden("Garage does not support anonymous access yet"))?;