aboutsummaryrefslogtreecommitdiffstats
path: root/examples/ignore_websocket.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ignore_websocket.py')
-rw-r--r--examples/ignore_websocket.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/ignore_websocket.py b/examples/ignore_websocket.py
index 48093951..f7a94bdf 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.