diff options
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/s3_cors.rs | 7 | ||||
-rw-r--r-- | src/api/s3_list.rs | 6 | ||||
-rw-r--r-- | src/api/s3_website.rs | 3 | ||||
-rw-r--r-- | src/api/signature/payload.rs | 2 |
4 files changed, 6 insertions, 12 deletions
diff --git a/src/api/s3_cors.rs b/src/api/s3_cors.rs index e3deaeda..ab77e23a 100644 --- a/src/api/s3_cors.rs +++ b/src/api/s3_cors.rs @@ -200,12 +200,7 @@ pub fn find_matching_cors_rule<'a>( None => vec![], }; return Ok(cors_config.iter().find(|rule| { - cors_rule_matches( - rule, - origin, - &req.method().to_string(), - request_headers.iter(), - ) + cors_rule_matches(rule, origin, req.method().as_ref(), request_headers.iter()) })); } } diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs index 92998159..5852fc1b 100644 --- a/src/api/s3_list.rs +++ b/src/api/s3_list.rs @@ -1042,12 +1042,12 @@ mod tests { query.common.prefix = "a/".to_string(); assert_eq!( - common_prefix(&objs.get(0).unwrap(), &query.common), + common_prefix(objs.get(0).unwrap(), &query.common), Some("a/b/") ); query.common.prefix = "a/b/".to_string(); - assert_eq!(common_prefix(&objs.get(0).unwrap(), &query.common), None); + assert_eq!(common_prefix(objs.get(0).unwrap(), &query.common), None); } #[test] @@ -1272,7 +1272,7 @@ mod tests { Version { bucket_id: uuid, key: "a".to_string(), - uuid: uuid, + uuid, deleted: false.into(), blocks: crdt::Map::<VersionBlockKey, VersionBlock>::from_iter(blocks), parts_etags: crdt::Map::<u64, String>::from_iter(etags), diff --git a/src/api/s3_website.rs b/src/api/s3_website.rs index 9d1da905..b464dd45 100644 --- a/src/api/s3_website.rs +++ b/src/api/s3_website.rs @@ -259,8 +259,7 @@ impl RoutingRuleInner { let has_prefix = self .condition .as_ref() - .map(|c| c.prefix.as_ref()) - .flatten() + .and_then(|c| c.prefix.as_ref()) .is_some(); self.redirect.validate(has_prefix) } diff --git a/src/api/signature/payload.rs b/src/api/signature/payload.rs index 85687a23..88b58922 100644 --- a/src/api/signature/payload.rs +++ b/src/api/signature/payload.rs @@ -51,7 +51,7 @@ pub async fn check_payload_signature( let canonical_request = canonical_request( request.method(), - &request.uri().path().to_string(), + request.uri().path(), &canonical_query_string(request.uri()), &headers, &authorization.signed_headers, |