From 78e6149d9f9df4d108e08c1c8463824c8dc311a3 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 10 Oct 2017 12:39:24 -0700 Subject: [PATCH] fix connection upgrade --- src/task.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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")); }