mirror of
https://github.com/actix/actix-web.git
synced 2024-12-30 03:50:42 +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> {
|
||||
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> {
|
||||
RESPONSE_POOL.with(|p| *p)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue