From d3d2c77ad76b597b7094edd8684c17033befe1cb Mon Sep 17 00:00:00 2001 From: aumetra Date: Sat, 17 Feb 2024 12:37:04 +0100 Subject: [PATCH] remove shrink to fit --- lib/http-signatures/src/cavage/signature_string.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/http-signatures/src/cavage/signature_string.rs b/lib/http-signatures/src/cavage/signature_string.rs index 40a3165f4..45c30f3da 100644 --- a/lib/http-signatures/src/cavage/signature_string.rs +++ b/lib/http-signatures/src/cavage/signature_string.rs @@ -41,17 +41,18 @@ where I: Iterator + Clone, { let header_names = signature_header.headers.clone().collect::>(); - let fulfills_min_requirements = match *request.method() { + let fulfils_min_requirements = match *request.method() { Method::GET => is_subset(REQUIRED_GET_HEADERS, &header_names), Method::POST => is_subset(REQUIRED_POST_HEADERS, &header_names), _ => return Err(Error::InvalidMethod), }; - if !fulfills_min_requirements { + if !fulfils_min_requirements { return Err(Error::MissingHeaderNames); } let mut signature_string = String::new(); + for name in header_names { match name { name @ "(request-target)" => { @@ -83,8 +84,6 @@ where } } - signature_string.shrink_to_fit(); - Ok(signature_string) }