Let hyper automatically add a host header for HTTP/1

This commit is contained in:
Jan Andre Ikenmeyer 2019-12-14 15:51:24 +01:00
parent 3f663d7ab2
commit 19226c5190
No known key found for this signature in database
GPG key ID: 28F9E42748DD95AE
4 changed files with 7 additions and 40 deletions

View file

@ -14,11 +14,8 @@ use devtools_traits::HttpRequest as DevtoolsHttpRequest;
use devtools_traits::HttpResponse as DevtoolsHttpResponse;
use headers::{AccessControlAllowCredentials, AccessControlAllowHeaders, AccessControlAllowOrigin};
use headers::{AccessControlAllowMethods, AccessControlMaxAge, HeaderMapExt};
use headers::{
CacheControl, ContentLength, ContentType, Expires, Host, LastModified, Pragma, UserAgent,
};
use headers::{CacheControl, ContentLength, ContentType, Expires, LastModified, Pragma, UserAgent};
use http::header::{self, HeaderMap, HeaderName, HeaderValue};
use http::uri::Authority;
use http::{Method, StatusCode};
use hyper::body::Body;
use hyper::{Request as HyperRequest, Response as HyperResponse};
@ -1067,11 +1064,6 @@ fn test_fetch_with_devtools() {
header::ACCEPT_ENCODING,
HeaderValue::from_static("gzip, deflate, br"),
);
headers.typed_insert(Host::from(
format!("{}:{}", url.host_str().unwrap(), url.port().unwrap())
.parse::<Authority>()
.unwrap(),
));
headers.insert(header::ACCEPT, HeaderValue::from_static("*/*"));

View file

@ -257,11 +257,6 @@ fn test_request_and_response_data_with_network_messages() {
header::ACCEPT_ENCODING,
HeaderValue::from_static("gzip, deflate, br"),
);
headers.typed_insert(Host::from(
format!("{}:{}", url.host_str().unwrap(), url.port().unwrap())
.parse::<Authority>()
.unwrap(),
));
headers.insert(
header::ACCEPT,