diff options
Diffstat (limited to 'pathod/protocols')
-rw-r--r-- | pathod/protocols/http.py | 2 | ||||
-rw-r--r-- | pathod/protocols/http2.py | 22 | ||||
-rw-r--r-- | pathod/protocols/websockets.py | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/pathod/protocols/http.py b/pathod/protocols/http.py index a20a58a1..4387b4fb 100644 --- a/pathod/protocols/http.py +++ b/pathod/protocols/http.py @@ -1,6 +1,6 @@ from mitmproxy import version from mitmproxy import exceptions -from netlib.http import http1 +from mitmproxy.net.http import http1 from .. import language diff --git a/pathod/protocols/http2.py b/pathod/protocols/http2.py index 838469d6..118163d2 100644 --- a/pathod/protocols/http2.py +++ b/pathod/protocols/http2.py @@ -4,10 +4,10 @@ import time import hyperframe.frame from hpack.hpack import Encoder, Decoder -from netlib.http import http2 -import netlib.http.headers -import netlib.http.response -import netlib.http.request +from mitmproxy.net.http import http2 +import mitmproxy.net.http.headers +import mitmproxy.net.http.response +import mitmproxy.net.http.request from mitmproxy.types import bidi from .. import language @@ -100,7 +100,7 @@ class HTTP2StateProtocol: first_line_format, method, scheme, host, port, path = http2.parse_headers(headers) - request = netlib.http.request.Request( + request = mitmproxy.net.http.request.Request( first_line_format, method, scheme, @@ -148,7 +148,7 @@ class HTTP2StateProtocol: else: timestamp_end = None - response = netlib.http.response.Response( + response = mitmproxy.net.http.response.Response( b"HTTP/2.0", int(headers.get(':status', 502)), b'', @@ -162,15 +162,15 @@ class HTTP2StateProtocol: return response def assemble(self, message): - if isinstance(message, netlib.http.request.Request): + if isinstance(message, mitmproxy.net.http.request.Request): return self.assemble_request(message) - elif isinstance(message, netlib.http.response.Response): + elif isinstance(message, mitmproxy.net.http.response.Response): return self.assemble_response(message) else: raise ValueError("HTTP message not supported.") def assemble_request(self, request): - assert isinstance(request, netlib.http.request.Request) + assert isinstance(request, mitmproxy.net.http.request.Request) authority = self.tcp_handler.sni if self.tcp_handler.sni else self.tcp_handler.address.host if self.tcp_handler.address.port != 443: @@ -194,7 +194,7 @@ class HTTP2StateProtocol: self._create_body(request.body, stream_id))) def assemble_response(self, response): - assert isinstance(response, netlib.http.response.Response) + assert isinstance(response, mitmproxy.net.http.response.Response) headers = response.headers.copy() @@ -394,7 +394,7 @@ class HTTP2StateProtocol: else: self._handle_unexpected_frame(frm) - headers = netlib.http.headers.Headers( + headers = mitmproxy.net.http.headers.Headers( [[k, v] for k, v in self.decoder.decode(header_blocks, raw=True)] ) diff --git a/pathod/protocols/websockets.py b/pathod/protocols/websockets.py index 585a48e3..00ae5aa8 100644 --- a/pathod/protocols/websockets.py +++ b/pathod/protocols/websockets.py @@ -1,6 +1,6 @@ import time -from netlib import websockets +from mitmproxy.net import websockets from pathod import language from mitmproxy import exceptions |