Update to http 0.2 (#432)

This commit is contained in:
Sean McArthur
2019-12-02 16:22:26 -08:00
committed by GitHub
parent e7e75bf117
commit eab9c0b410
6 changed files with 17 additions and 10 deletions

View File

@@ -1375,7 +1375,7 @@ impl proto::Peer for Peer {
// A request translated from HTTP/1 must not include the :authority
// header
if let Some(authority) = pseudo.authority {
let maybe_authority = uri::Authority::from_shared(authority.clone().into_inner());
let maybe_authority = uri::Authority::from_maybe_shared(authority.clone().into_inner());
parts.authority = Some(maybe_authority.or_else(|why| {
malformed!(
"malformed headers: malformed authority ({:?}): {}",
@@ -1387,7 +1387,7 @@ impl proto::Peer for Peer {
// A :scheme is always required.
if let Some(scheme) = pseudo.scheme {
let maybe_scheme = uri::Scheme::from_shared(scheme.clone().into_inner());
let maybe_scheme = scheme.parse();
let scheme = maybe_scheme.or_else(|why| {
malformed!(
"malformed headers: malformed scheme ({:?}): {}",
@@ -1412,7 +1412,7 @@ impl proto::Peer for Peer {
malformed!("malformed headers: missing path");
}
let maybe_path = uri::PathAndQuery::from_shared(path.clone().into_inner());
let maybe_path = uri::PathAndQuery::from_maybe_shared(path.clone().into_inner());
parts.path_and_query = Some(maybe_path.or_else(|why| {
malformed!("malformed headers: malformed path ({:?}): {}", path, why,)
})?);