diff options
author | Alex <lx@deuxfleurs.fr> | 2025-02-14 14:07:01 +0000 |
---|---|---|
committer | Alex <lx@deuxfleurs.fr> | 2025-02-14 14:07:01 +0000 |
commit | 627a37fe9fdde4798ff6131c6597dace8d5bd830 (patch) | |
tree | b77baa8372b655cb06cc48453a1862342d6b952e | |
parent | a1533d291942b8daa2550f7e5f4bad8a8e29c8bc (diff) | |
parent | c1b39d9ba15ffef5ba4cb1d3e5eac89c670acb05 (diff) | |
download | garage-627a37fe9fdde4798ff6131c6597dace8d5bd830.tar.gz garage-627a37fe9fdde4798ff6131c6597dace8d5bd830.zip |
Merge pull request 's3 api: parse x-id query parameter and warn of any inconsistency (fix #822)' (#954) from fix-822 into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/954
-rw-r--r-- | src/api/s3/router.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/api/s3/router.rs b/src/api/s3/router.rs index 9de84b2b..e3f58490 100644 --- a/src/api/s3/router.rs +++ b/src/api/s3/router.rs @@ -352,6 +352,18 @@ impl Endpoint { _ => return Err(Error::bad_request("Unknown method")), }; + if let Some(x_id) = query.x_id.take() { + if x_id != res.name() { + // I think AWS ignores the x-id parameter. + // Let's make this at least be a warnin to help debugging. + warn!( + "x-id ({}) does not match parsed endpoint ({})", + x_id, + res.name() + ); + } + } + if let Some(message) = query.nonempty_message() { debug!("Unused query parameter: {}", message) } @@ -696,7 +708,8 @@ generateQueryParameters! { "uploadId" => upload_id, "upload-id-marker" => upload_id_marker, "versionId" => version_id, - "version-id-marker" => version_id_marker + "version-id-marker" => version_id_marker, + "x-id" => x_id ] } |