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.