aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http.py
diff options
context:
space:
mode:
authorChandler Abraham <cabraham@twitter.com>2015-04-13 13:36:09 -0700
committerChandler Abraham <cabraham@twitter.com>2015-04-13 13:36:09 -0700
commit2d72a1b6b56f1643cd1d8be59eee55aa7ca2f17f (patch)
tree8e2831fdd659174703f00b4b1cd008cfb70185a2 /netlib/http.py
parent0ed2a290639833d772b89cf333577820e84f8204 (diff)
downloadmitmproxy-2d72a1b6b56f1643cd1d8be59eee55aa7ca2f17f.tar.gz
mitmproxy-2d72a1b6b56f1643cd1d8be59eee55aa7ca2f17f.tar.bz2
mitmproxy-2d72a1b6b56f1643cd1d8be59eee55aa7ca2f17f.zip
100% test coverage, though still need plenty more
Diffstat (limited to 'netlib/http.py')
-rw-r--r--netlib/http.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/netlib/http.py b/netlib/http.py
index 2c72621d..26438863 100644
--- a/netlib/http.py
+++ b/netlib/http.py
@@ -29,20 +29,6 @@ def _is_valid_host(host):
return None
return True
-def is_successful_upgrade(request, response):
- """
- determines if a client and server successfully agreed to an HTTP protocol upgrade
-
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism
- """
- http_switching_protocols_code = 101
-
- if request and response:
- responseUpgrade = request.headers.get("Upgrade")
- requestUpgrade = response.headers.get("Upgrade")
- if response.code == http_switching_protocols_code and responseUpgrade == requestUpgrade:
- return requestUpgrade[0] if len(requestUpgrade) > 0 else None
- return None
def parse_url(url):
"""