diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-08 12:00:17 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-08 12:00:17 +1200 |
commit | b1d2da19f952ee677ec9c86d13ac2f28db824275 (patch) | |
tree | a0f918f377226535791fa092631c494f6611642e /examples/ignore_websocket.py | |
parent | fb0a5d8f6383e689ccfbb498b0b3501dbdf712e2 (diff) | |
parent | 0aa2fca25aa5511c89653d876a39eec6e812e184 (diff) | |
download | mitmproxy-b1d2da19f952ee677ec9c86d13ac2f28db824275.tar.gz mitmproxy-b1d2da19f952ee677ec9c86d13ac2f28db824275.tar.bz2 mitmproxy-b1d2da19f952ee677ec9c86d13ac2f28db824275.zip |
Merge branch 'master' of ssh.github.com:mitmproxy/mitmproxy
Diffstat (limited to 'examples/ignore_websocket.py')
-rw-r--r-- | examples/ignore_websocket.py | 3 |
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. |