diff options
author | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-14 14:30:46 +0100 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-14 14:30:58 +0100 |
commit | c1b39d9ba15ffef5ba4cb1d3e5eac89c670acb05 (patch) | |
tree | 704ea6048e75c864d77935fbe21cca2c20b61a37 | |
parent | 63f20bdeabfef21cf4f8c91a542bf3d0f5e77ad6 (diff) | |
download | garage-c1b39d9ba15ffef5ba4cb1d3e5eac89c670acb05.tar.gz garage-c1b39d9ba15ffef5ba4cb1d3e5eac89c670acb05.zip |
s3 api: parse x-id query parameter and warn of any inconsistency (fix #822)fix-822
-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 ] } |