diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-12-19 01:15:10 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-12-19 01:15:10 +0100 |
commit | c4e90000210c392464944261c44e0bf1ed08608c (patch) | |
tree | 986ab36e78744016188ec3ec7709fb39198f3d34 /mitmproxy/net/http | |
parent | 377be68cac921917b241f8aee2170f7084dbf93d (diff) | |
download | mitmproxy-c4e90000210c392464944261c44e0bf1ed08608c.tar.gz mitmproxy-c4e90000210c392464944261c44e0bf1ed08608c.tar.bz2 mitmproxy-c4e90000210c392464944261c44e0bf1ed08608c.zip |
fix #1858
Diffstat (limited to 'mitmproxy/net/http')
-rw-r--r-- | mitmproxy/net/http/request.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mitmproxy/net/http/request.py b/mitmproxy/net/http/request.py index c3d85363..7cc4def7 100644 --- a/mitmproxy/net/http/request.py +++ b/mitmproxy/net/http/request.py @@ -350,6 +350,8 @@ class Request(message.Message): The URL-encoded form data as an :py:class:`~mitmproxy.net.multidict.MultiDictView` object. An empty multidict.MultiDictView if the content-type indicates non-form data or the content could not be parsed. + + Starting with mitmproxy 1.0, key and value are strings. """ return multidict.MultiDictView( self._get_urlencoded_form, @@ -360,7 +362,7 @@ class Request(message.Message): is_valid_content_type = "application/x-www-form-urlencoded" in self.headers.get("content-type", "").lower() if is_valid_content_type: try: - return tuple(mitmproxy.net.http.url.decode(self.content)) + return tuple(mitmproxy.net.http.url.decode(self.content.decode())) except ValueError: pass return () @@ -381,7 +383,10 @@ class Request(message.Message): def multipart_form(self): """ The multipart form data as an :py:class:`~mitmproxy.net.multidict.MultiDictView` object. - None if the content-type indicates non-form data. + An empty multidict.MultiDictView if the content-type indicates non-form data + or the content could not be parsed. + + Key and value are bytes. """ return multidict.MultiDictView( self._get_multipart_form, |