From 9674a0869c2a333f74178e305677259e7ac379c3 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 31 Mar 2015 16:07:04 +0900 Subject: [PATCH] Make the Websocket's connection header value case-insensitive --- examples/ignore_websocket.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/ignore_websocket.py b/examples/ignore_websocket.py index 48093951e..f7a94bdf3 100644 --- a/examples/ignore_websocket.py +++ b/examples/ignore_websocket.py @@ -26,7 +26,8 @@ def done(context): @concurrent def response(context, flow): - if flow.response.headers.get_first("Connection", None) == "Upgrade": + value = flow.response.headers.get_first("Connection", None) + if value and value.upper() == "UPGRADE": # We need to send the response manually now... flow.client_conn.send(flow.response.assemble()) # ...and then delegate to tcp passthrough.