mirror of https://github.com/fafhrd91/actix-web
Make sure to check if headers already have a HOST value before setting
This commit is contained in:
parent
07875bf211
commit
d3c6757a98
|
@ -233,7 +233,9 @@ 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());
|
if !self.head.headers.contains_key(header::HOST) {
|
||||||
|
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 {
|
||||||
|
|
Loading…
Reference in New Issue