mirror of
https://github.com/actix/actix-web.git
synced 2025-01-19 21:55:31 +00:00
fix response upgrade type
This commit is contained in:
parent
3301a46264
commit
fd86d73a03
1 changed files with 16 additions and 0 deletions
|
@ -106,6 +106,18 @@ impl Head for RequestHead {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upgrade(&self) -> bool {
|
||||||
|
if let Some(hdr) = self.headers().get(header::CONNECTION) {
|
||||||
|
if let Ok(s) = hdr.to_str() {
|
||||||
|
s.to_ascii_lowercase().contains("upgrade")
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn pool() -> &'static MessagePool<Self> {
|
fn pool() -> &'static MessagePool<Self> {
|
||||||
REQUEST_POOL.with(|p| *p)
|
REQUEST_POOL.with(|p| *p)
|
||||||
}
|
}
|
||||||
|
@ -194,6 +206,10 @@ impl Head for ResponseHead {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn upgrade(&self) -> bool {
|
||||||
|
self.connection_type() == ConnectionType::Upgrade
|
||||||
|
}
|
||||||
|
|
||||||
fn pool() -> &'static MessagePool<Self> {
|
fn pool() -> &'static MessagePool<Self> {
|
||||||
RESPONSE_POOL.with(|p| *p)
|
RESPONSE_POOL.with(|p| *p)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue