From dc6dd19a440001199d51cd13aedbfaf8a58e1f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 28 Dec 2021 15:42:06 +0100 Subject: [PATCH] parsers: http_upload: allow any case header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- parsers/src/http_upload.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parsers/src/http_upload.rs b/parsers/src/http_upload.rs index e76aea0..228f85a 100644 --- a/parsers/src/http_upload.rs +++ b/parsers/src/http_upload.rs @@ -50,10 +50,10 @@ impl TryFrom for Header { let name: String = get_attr!(elem, "name", Required); let text = String::from(elem.text()); - Ok(match name.as_str() { - "Authorization" => Header::Authorization(text), - "Cookie" => Header::Cookie(text), - "Expires" => Header::Expires(text), + Ok(match name.to_lowercase().as_str() { + "authorization" => Header::Authorization(text), + "cookie" => Header::Cookie(text), + "expires" => Header::Expires(text), _ => { return Err(Error::ParseError( "Header name must be either 'Authorization', 'Cookie', or 'Expires'.",