diff --git a/src/task.rs b/src/task.rs index dcf276374..164e1f1a4 100644 --- a/src/task.rs +++ b/src/task.rs @@ -138,8 +138,12 @@ impl Task { } } + // Connection upgrade + if msg.upgrade() { + msg.headers.insert(CONNECTION, HeaderValue::from_static("upgrade")); + } // keep-alive - if msg.keep_alive() { + else if msg.keep_alive() { if msg.version < Version::HTTP_11 { msg.headers.insert(CONNECTION, HeaderValue::from_static("keep-alive")); }