diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-06-16 13:52:41 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-06-16 14:53:41 +0200 |
commit | 408b4ffef0a784bea7ec08c252e757bca6e28134 (patch) | |
tree | f7694eb9f7f875d72355b9f7c342910174574fc0 /libpathod/language/http2.py | |
parent | ec68aa303e89398ba34bbe01f3fbd1ac1fc441f3 (diff) | |
download | mitmproxy-408b4ffef0a784bea7ec08c252e757bca6e28134.tar.gz mitmproxy-408b4ffef0a784bea7ec08c252e757bca6e28134.tar.bz2 mitmproxy-408b4ffef0a784bea7ec08c252e757bca6e28134.zip |
http2: implement Headers for request & response
improve test coverage
fix super ctor call
fix legacy httpversion
simpliy SSLInfo without ALPN
Diffstat (limited to 'libpathod/language/http2.py')
-rw-r--r-- | libpathod/language/http2.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libpathod/language/http2.py b/libpathod/language/http2.py index c28b904e..dec2d5fe 100644 --- a/libpathod/language/http2.py +++ b/libpathod/language/http2.py @@ -35,8 +35,15 @@ class Path(base.Value): class Header(base.KeyValue): + unique_name = None preamble = "h" + def values(self, settings): + return ( + self.key.get_generator(settings), + self.value.get_generator(settings), + ) + class Body(base.Value): preamble = "b" @@ -45,9 +52,11 @@ class Body(base.Value): class Times(base.Integer): preamble = "x" + class Code(base.Integer): pass + class Request(message.Message): comps = ( Header, @@ -57,7 +66,7 @@ class Request(message.Message): logattrs = ["method", "path"] def __init__(self, tokens): - super(Response, self).__init__(tokens) + super(Request, self).__init__(tokens) self.rendered_values = None @property @@ -106,9 +115,7 @@ class Request(message.Message): if self.rendered_values: return self.rendered_values else: - headers = self.headers - if headers: - headers = headers.values(settings) + headers = [header.values(settings) for header in self.headers] body = self.body if body: @@ -173,9 +180,7 @@ class Response(message.Message): if self.rendered_values: return self.rendered_values else: - headers = self.headers - if headers: - headers = headers.values(settings) + headers = [header.values(settings) for header in self.headers] body = self.body if body: |