diff options
author | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-18 13:59:43 +0100 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-18 15:33:42 +0100 |
commit | 730bfee753c4f22cd0595d9195222de334ec36f9 (patch) | |
tree | 10cae28065967f82adcb145e027c15c38b9502be /src/api/s3/post_object.rs | |
parent | ccab0e4ae5c083d0a06ad2b3ef5fe62481da3c2c (diff) | |
download | garage-730bfee753c4f22cd0595d9195222de334ec36f9.tar.gz garage-730bfee753c4f22cd0595d9195222de334ec36f9.zip |
api: validate trailing checksum + add test for unsigned-paylad-trailer
Diffstat (limited to 'src/api/s3/post_object.rs')
-rw-r--r-- | src/api/s3/post_object.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/s3/post_object.rs b/src/api/s3/post_object.rs index 6c1b7453..350684da 100644 --- a/src/api/s3/post_object.rs +++ b/src/api/s3/post_object.rs @@ -218,6 +218,7 @@ pub async fn handle_post_object( // around here to make sure the rest of the machinery takes our acl into account. let headers = get_headers(¶ms)?; + let checksum_algorithm = request_checksum_algorithm(¶ms)?; let expected_checksums = ExpectedChecksums { md5: params .get("content-md5") @@ -225,7 +226,9 @@ pub async fn handle_post_object( .transpose()? .map(str::to_string), sha256: None, - extra: request_checksum_algorithm_value(¶ms)?, + extra: checksum_algorithm + .map(|algo| extract_checksum_value(¶ms, algo)) + .transpose()?, }; let meta = ObjectVersionMetaInner { |