mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
parsers: http_upload: allow any case header
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
9b6fcd1bd7
commit
dc6dd19a44
1 changed files with 4 additions and 4 deletions
|
@ -50,10 +50,10 @@ impl TryFrom<Element> for Header {
|
||||||
let name: String = get_attr!(elem, "name", Required);
|
let name: String = get_attr!(elem, "name", Required);
|
||||||
let text = String::from(elem.text());
|
let text = String::from(elem.text());
|
||||||
|
|
||||||
Ok(match name.as_str() {
|
Ok(match name.to_lowercase().as_str() {
|
||||||
"Authorization" => Header::Authorization(text),
|
"authorization" => Header::Authorization(text),
|
||||||
"Cookie" => Header::Cookie(text),
|
"cookie" => Header::Cookie(text),
|
||||||
"Expires" => Header::Expires(text),
|
"expires" => Header::Expires(text),
|
||||||
_ => {
|
_ => {
|
||||||
return Err(Error::ParseError(
|
return Err(Error::ParseError(
|
||||||
"Header name must be either 'Authorization', 'Cookie', or 'Expires'.",
|
"Header name must be either 'Authorization', 'Cookie', or 'Expires'.",
|
||||||
|
|
Loading…
Reference in a new issue