fix(cli): Correctly parse http headers from cmd line

This commit is contained in:
Σrebe - Romain GERARD 2023-10-28 23:09:37 +02:00
parent 274ea6a4b9
commit ce297f219c
No known key found for this signature in database
GPG key ID: 7A42B4B97E0332F4

View file

@ -342,7 +342,7 @@ fn parse_sni_override(arg: &str) -> Result<DnsName, io::Error> {
}
}
fn parse_http_headers(arg: &str) -> Result<(String, HeaderValue), io::Error> {
fn parse_http_headers(arg: &str) -> Result<(HeaderName, HeaderValue), io::Error> {
let Some((key, value)) = arg.split_once(':') else {
return Err(io::Error::new(
ErrorKind::InvalidInput,
@ -363,7 +363,7 @@ fn parse_http_headers(arg: &str) -> Result<(String, HeaderValue), io::Error> {
}
};
Ok((key.to_owned(), value))
Ok((HeaderName::from_str(key).unwrap(), value))
}
fn parse_http_credentials(arg: &str) -> Result<HeaderValue, io::Error> {