diff options
Diffstat (limited to 'mitmproxy/contentviews.py')
-rw-r--r-- | mitmproxy/contentviews.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mitmproxy/contentviews.py b/mitmproxy/contentviews.py index 1b0f389f..08a7e446 100644 --- a/mitmproxy/contentviews.py +++ b/mitmproxy/contentviews.py @@ -27,7 +27,9 @@ import html2text import six from netlib.odict import ODict from netlib import encoding -from netlib.utils import clean_bin, hexdump, urldecode, multipartdecode, parse_content_type +import netlib.http.headers +from netlib.http import url, multipart +from netlib.utils import clean_bin, hexdump from . import utils from .exceptions import ContentViewException from .contrib import jsbeautifier @@ -120,7 +122,7 @@ class ViewAuto(View): headers = metadata.get("headers", {}) ctype = headers.get("content-type") if data and ctype: - ct = parse_content_type(ctype) if ctype else None + ct = netlib.http.headers.parse_content_type(ctype) if ctype else None ct = "%s/%s" % (ct[0], ct[1]) if ct in content_types_map: return content_types_map[ct][0](data, **metadata) @@ -257,7 +259,7 @@ class ViewURLEncoded(View): content_types = ["application/x-www-form-urlencoded"] def __call__(self, data, **metadata): - d = urldecode(data) + d = url.decode(data) return "URLEncoded form", format_dict(ODict(d)) @@ -274,7 +276,7 @@ class ViewMultipart(View): def __call__(self, data, **metadata): headers = metadata.get("headers", {}) - v = multipartdecode(headers, data) + v = multipart.decode(headers, data) if v: return "Multipart form", self._format(v) |