diff options
Diffstat (limited to 'libmproxy/console')
-rw-r--r-- | libmproxy/console/contentview.py | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/libmproxy/console/contentview.py b/libmproxy/console/contentview.py index 95d908a4..12ed5b64 100644 --- a/libmproxy/console/contentview.py +++ b/libmproxy/console/contentview.py @@ -240,33 +240,13 @@ class ViewMultipart: content_types = ["multipart/form-data"] def __call__(self, hdrs, content, limit): - v = hdrs.get_first("content-type") + v = utils.multipartdecode(hdrs, content) if v: - v = utils.parse_content_type(v) - if not v: - return - boundary = v[2].get("boundary") - if not boundary: - return - - rx = re.compile(r'\bname="([^"]+)"') - keys = [] - vals = [] - - for i in content.split("--" + boundary): - parts = i.splitlines() - if len(parts) > 1 and parts[0][0:2] != "--": - match = rx.search(parts[1]) - if match: - keys.append(match.group(1) + ":") - vals.append(netlib.utils.cleanBin( - "\n".join(parts[3+parts[2:].index(""):]) - )) r = [ urwid.Text(("highlight", "Form data:\n")), ] r.extend(common.format_keyvals( - zip(keys, vals), + v, key = "header", val = "text" )) |