diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-11-05 16:20:38 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-11-12 11:58:04 +1300 |
commit | fbaade429845546d751110caa0f886f7b1a62717 (patch) | |
tree | 9079cbcfea0ab4c66c056af321818dc0f035ec78 | |
parent | 39589404209a9980c0a07137f367f70c103e3113 (diff) | |
download | mitmproxy-fbaade429845546d751110caa0f886f7b1a62717.tar.gz mitmproxy-fbaade429845546d751110caa0f886f7b1a62717.tar.bz2 mitmproxy-fbaade429845546d751110caa0f886f7b1a62717.zip |
Remove promotion to raw TCP based on heuristics
This seems terribly dangerous to me. Let's expand explicit control instead.
-rw-r--r-- | mitmproxy/proxy/protocol/http.py | 2 | ||||
-rw-r--r-- | mitmproxy/proxy/root_context.py | 11 |
2 files changed, 2 insertions, 11 deletions
diff --git a/mitmproxy/proxy/protocol/http.py b/mitmproxy/proxy/protocol/http.py index 9fe83ff6..3bc33ab0 100644 --- a/mitmproxy/proxy/protocol/http.py +++ b/mitmproxy/proxy/protocol/http.py @@ -138,7 +138,7 @@ class HttpLayer(base.Layer): def __init__(self, ctx, mode): super().__init__(ctx) if mode not in MODES: - raise exceptions.ServerException("Invalid mode: %s"%mode) + raise exceptions.ServerException("Invalid mode: %s" % mode) self.mode = mode self.__initial_server_conn = None "Contains the original destination in transparent mode, which needs to be restored" diff --git a/mitmproxy/proxy/root_context.py b/mitmproxy/proxy/root_context.py index eacf7e0b..4362347b 100644 --- a/mitmproxy/proxy/root_context.py +++ b/mitmproxy/proxy/root_context.py @@ -90,16 +90,7 @@ class RootContext: if alpn == b'http/1.1': return protocol.Http1Layer(top_layer, 'transparent') - # 6. Check for raw tcp mode - is_ascii = ( - len(d) == 3 and - # expect A-Za-z - all(65 <= x <= 90 or 97 <= x <= 122 for x in d) - ) - if self.config.options.rawtcp and not is_ascii: - return protocol.RawTCPLayer(top_layer) - - # 7. Assume HTTP1 by default + # 6. Assume HTTP1 by default return protocol.Http1Layer(top_layer, 'transparent') def log(self, msg, level, subs=()): |