mirror of
https://github.com/actix/actix-web.git
synced 2025-03-30 14:49:35 +00:00
properly handle upgrade header if content-length header is set
This commit is contained in:
parent
6a1d560f22
commit
dea39030bc
1 changed files with 7 additions and 0 deletions
|
@ -141,6 +141,13 @@ impl Decoder for RequestDecoder {
|
||||||
}
|
}
|
||||||
header::UPGRADE => {
|
header::UPGRADE => {
|
||||||
has_upgrade = true;
|
has_upgrade = true;
|
||||||
|
// check content-length, some clients (dart)
|
||||||
|
// sends "content-length: 0" with websocket upgrade
|
||||||
|
if let Ok(val) = value.to_str() {
|
||||||
|
if val == "websocket" {
|
||||||
|
content_length = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue