diff options
author | trinity-1686a <trinity.pointard@gmail.com> | 2022-01-18 12:22:31 +0100 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-01-18 12:22:31 +0100 |
commit | e55fa38c9995294edcdf0f7f4f95dc767b343fb5 (patch) | |
tree | d2a43ac455f87bee797a8f1caf083ab807b0d942 /src/api/s3_copy.rs | |
parent | 178e35f868d3102342838f5669da44b4eb0fc4f3 (diff) | |
download | garage-e55fa38c9995294edcdf0f7f4f95dc767b343fb5.tar.gz garage-e55fa38c9995294edcdf0f7f4f95dc767b343fb5.zip |
Add date verification to presigned urls (#196)
fix #96
fix #162 by returning Forbidden instead Bad Request
Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/196
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
Diffstat (limited to 'src/api/s3_copy.rs')
-rw-r--r-- | src/api/s3_copy.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/s3_copy.rs b/src/api/s3_copy.rs index f8b3550e..93947b78 100644 --- a/src/api/s3_copy.rs +++ b/src/api/s3_copy.rs @@ -487,7 +487,7 @@ impl CopyPreconditionHeaders { .get("x-amz-copy-source-if-modified-since") .map(|x| x.to_str()) .transpose()? - .map(|x| httpdate::parse_http_date(x)) + .map(httpdate::parse_http_date) .transpose() .ok_or_bad_request("Invalid date in x-amz-copy-source-if-modified-since")?, copy_source_if_none_match: req @@ -505,7 +505,7 @@ impl CopyPreconditionHeaders { .get("x-amz-copy-source-if-unmodified-since") .map(|x| x.to_str()) .transpose()? - .map(|x| httpdate::parse_http_date(x)) + .map(httpdate::parse_http_date) .transpose() .ok_or_bad_request("Invalid date in x-amz-copy-source-if-unmodified-since")?, }) |