// NOTE: we use our own `Authority type` here because an invalid port number would return `None` here
http_helpers::read_header_value(request.headers(), hyper::header::HOST).map(Authority::try_from);
assert_eq!(Authority::try_from("http://parity.io").unwrap(), authority("parity.io", Port::Default));
assert_eq!(Authority::try_from("https://parity.io:8443").unwrap(), authority("parity.io", Port::Fixed(8443)));
assert_eq!(Authority::try_from("chrome-extension://124.0.0.1").unwrap(), authority("124.0.0.1", Port::Default));
assert_eq!(Authority::try_from("http://*.domain:*/somepath").unwrap(), authority("*.domain", Port::Any));
assert_eq!(Authority::try_from("127.0.0.1:8845").unwrap(), authority("127.0.0.1", Port::Fixed(8845)));
HttpRequest::builder().header(HOST, "example.com:9999").uri("example.com").body(EmptyBody::new()).unwrap();