From aebe34202553bea24a5d4e99b9f218b58559c0f0 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 26 Aug 2015 14:03:51 +0200 Subject: improve alpn handling --- libmproxy/protocol2/http.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libmproxy/protocol2/http.py') diff --git a/libmproxy/protocol2/http.py b/libmproxy/protocol2/http.py index 5a25c317..649e7843 100644 --- a/libmproxy/protocol2/http.py +++ b/libmproxy/protocol2/http.py @@ -78,13 +78,14 @@ class Http2Layer(Layer): body_size_limit=self.config.body_size_limit ) self._stream_id = request.stream_id + return request def read_from_server(self, request_method): return HTTPResponse.from_protocol( self.server_protocol, request_method, body_size_limit=self.config.body_size_limit, - include_body=False, + include_body=True, stream_id=self._stream_id ) @@ -389,9 +390,11 @@ class HttpLayer(Layer): if flow is None or flow == KILL: raise Kill() - if flow.response.stream: + if isinstance(self.ctx, Http2Layer): + pass # streaming is not implemented for http2 yet. + elif flow.response.stream: flow.response.content = CONTENT_MISSING - elif isinstance(self.server_protocol, http1.HTTP1Protocol): + else: flow.response.content = self.server_protocol.read_http_body( flow.response.headers, self.config.body_size_limit, -- cgit v1.2.3