aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyo Onodera <ryoqun@gmail.com>2015-03-31 16:07:04 +0900
committerRyo Onodera <ryoqun@gmail.com>2015-03-31 16:07:04 +0900
commit9674a0869c2a333f74178e305677259e7ac379c3 (patch)
tree71c4109e0afc931a2e57303238aa8c6fd321cdb1
parent44fb42185f0e177b775c5e4f11249a55390048f6 (diff)
downloadmitmproxy-9674a0869c2a333f74178e305677259e7ac379c3.tar.gz
mitmproxy-9674a0869c2a333f74178e305677259e7ac379c3.tar.bz2
mitmproxy-9674a0869c2a333f74178e305677259e7ac379c3.zip
Make the Websocket's connection header value case-insensitive
-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.