aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Davies <jpds@protonmail.com>2023-08-01 15:17:53 +0100
committerJonathan Davies <jpds@protonmail.com>2023-08-01 15:31:39 +0100
commit59bfc68f2e9c6454297ec62f4703920086656c76 (patch)
tree308eb4f6fc530feee9432344a95658faf8ceb7de
parenta98855157bcac3c052c3ee12213f20d75356d358 (diff)
downloadgarage-59bfc68f2e9c6454297ec62f4703920086656c76.tar.gz
garage-59bfc68f2e9c6454297ec62f4703920086656c76.zip
post_object.rs: Fixed typos / grammar.
-rw-r--r--src/api/s3/post_object.rs12
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));
}