mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 23:17:42 +02:00
Ensure that awc::ws::WebsocketsRequest sets the Host header (#1070)
* Ensure that awc::ws::WebsocketsRequest sets the Host header before connecting. * Make sure to check if headers already have a HOST value before setting * Update CHANGES.md to reflect WebSocket client update.
This commit is contained in:
committed by
Nikolay Kim
parent
8a9fcddb3c
commit
8d61fe0925
@ -233,6 +233,10 @@ impl WebsocketsRequest {
|
||||
return Either::A(err(InvalidUrl::UnknownScheme.into()));
|
||||
}
|
||||
|
||||
if !self.head.headers.contains_key(header::HOST) {
|
||||
self.head.headers.insert(header::HOST, HeaderValue::from_str(uri.host().unwrap()).unwrap());
|
||||
}
|
||||
|
||||
// set cookies
|
||||
if let Some(ref mut jar) = self.cookies {
|
||||
let mut cookie = String::new();
|
||||
|
Reference in New Issue
Block a user