diff options
author | Alex <alex@adnab.me> | 2023-08-04 07:09:21 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2023-08-04 07:09:21 +0000 |
commit | 67b1457c77d930cd12f83f5cf07ec7f2376fa00c (patch) | |
tree | 308eb4f6fc530feee9432344a95658faf8ceb7de /src/api | |
parent | a98855157bcac3c052c3ee12213f20d75356d358 (diff) | |
parent | 59bfc68f2e9c6454297ec62f4703920086656c76 (diff) | |
download | garage-67b1457c77d930cd12f83f5cf07ec7f2376fa00c.tar.gz garage-67b1457c77d930cd12f83f5cf07ec7f2376fa00c.zip |
Merge pull request 'post_object.rs: Fixed typos / grammar.' (#607) from jpds/garage:post-objects-typos into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/607
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/s3/post_object.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/api/s3/post_object.rs b/src/api/s3/post_object.rs index f2098ab0..542b7a81 100644 --- a/src/api/s3/post_object.rs +++ b/src/api/s3/post_object.rs @@ -30,7 +30,7 @@ pub async fn handle_post_object( .get(header::CONTENT_TYPE) .and_then(|ct| ct.to_str().ok()) .and_then(|ct| multer::parse_boundary(ct).ok()) - .ok_or_bad_request("Counld not get multipart boundary")?; + .ok_or_bad_request("Could not get multipart boundary")?; // 16k seems plenty for a header. 5G is the max size of a single part, so it seems reasonable // for a PostObject @@ -64,15 +64,13 @@ pub async fn handle_post_object( "tag" => (/* tag need to be reencoded, but we don't support them yet anyway */), "acl" => { if params.insert("x-amz-acl", content).is_some() { - return Err(Error::bad_request( - "Field 'acl' provided more than one time", - )); + return Err(Error::bad_request("Field 'acl' provided more than once")); } } _ => { if params.insert(&name, content).is_some() { return Err(Error::bad_request(format!( - "Field '{}' provided more than one time", + "Field '{}' provided more than once", name ))); } @@ -149,7 +147,7 @@ pub async fn handle_post_object( .ok_or_bad_request("Invalid expiration date")? .into(); if Utc::now() - expiration > Duration::zero() { - return Err(Error::bad_request("Expiration date is in the paste")); + return Err(Error::bad_request("Expiration date is in the past")); } let mut conditions = decoded_policy.into_conditions()?; @@ -330,7 +328,7 @@ impl Policy { if map.len() != 1 { return Err(Error::bad_request("Invalid policy item")); } - let (mut k, v) = map.into_iter().next().expect("size was verified"); + let (mut k, v) = map.into_iter().next().expect("Size could not be verified"); k.make_ascii_lowercase(); params.entry(k).or_default().push(Operation::Equal(v)); } |