diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-06-08 13:09:40 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-06-08 13:09:40 +0200 |
commit | 696fe209e071fbe5881ceb152564b9fcb4fe1aae (patch) | |
tree | 75d9b46bbe4548509dfbc3bd671ff184e7d391e1 /pathod/language/http2.py | |
parent | e93fe9d4fa37ec1aae60eee612be7a9cd989891c (diff) | |
parent | 7d62121b858040935555098ec4c7323662b76e3b (diff) | |
download | mitmproxy-696fe209e071fbe5881ceb152564b9fcb4fe1aae.tar.gz mitmproxy-696fe209e071fbe5881ceb152564b9fcb4fe1aae.tar.bz2 mitmproxy-696fe209e071fbe5881ceb152564b9fcb4fe1aae.zip |
Merge pull request #1223 from dufferzafar/pathod-lang-http2
Python 3 - pathod.language.http2
Diffstat (limited to 'pathod/language/http2.py')
-rw-r--r-- | pathod/language/http2.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pathod/language/http2.py b/pathod/language/http2.py index 85d9047f..ea4fcd27 100644 --- a/pathod/language/http2.py +++ b/pathod/language/http2.py @@ -60,7 +60,7 @@ class _HTTP2Message(message.Message): headers = self.toks(_HeaderMixin) if not self.raw: - if not get_header("content-length", headers): + if not get_header(b"content-length", headers): if not self.body: length = 0 else: @@ -125,7 +125,7 @@ class ShortcutUserAgent(_HeaderMixin, base.OptionsOrValue): def values(self, settings): value = self.value.val if self.option_used: - value = user_agents.get_by_shortcut(value.lower())[2] + value = user_agents.get_by_shortcut(value.lower().decode())[2].encode() return ( self.key.get_generator(settings), @@ -190,7 +190,7 @@ class Response(_HTTP2Message): resp = http.Response( (2, 0), self.status_code.string(), - '', + b'', headers, body, ) @@ -262,7 +262,7 @@ class Request(_HTTP2Message): else: path = self.path.string() if self.nested_response: - path += self.nested_response.parsed.spec() + path += self.nested_response.parsed.spec().encode() headers = Headers([header.values(settings) for header in self.headers]) @@ -271,11 +271,11 @@ class Request(_HTTP2Message): body = body.string() req = http.Request( - '', + b'', self.method.string(), - '', - '', - '', + b'', + b'', + b'', path, (2, 0), headers, |