Ensure that awc::ws::WebsocketsRequest sets the Host header before connecting.

This commit is contained in:
Eugene Bulkin 2019-09-03 20:15:28 -05:00
parent c9400456f6
commit 07875bf211
1 changed files with 2 additions and 0 deletions

View File

@ -233,6 +233,8 @@ impl WebsocketsRequest {
return Either::A(err(InvalidUrl::UnknownScheme.into())); return Either::A(err(InvalidUrl::UnknownScheme.into()));
} }
self.head.headers.insert(header::HOST, HeaderValue::from_str(uri.host().unwrap()).unwrap());
// set cookies // set cookies
if let Some(ref mut jar) = self.cookies { if let Some(ref mut jar) = self.cookies {
let mut cookie = String::new(); let mut cookie = String::new();