diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-28 13:54:53 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-28 13:54:53 +0200 |
commit | c11ab3676dee2a490994665e867bcfcb26945777 (patch) | |
tree | f898c23973b10079fa4479238d5f8f5a8e61d46e /libmproxy/protocol | |
parent | 6661770d4eee3eab3305793613586f3684c24ae9 (diff) | |
parent | 6075957a9730c6ca5c4c7361bd774345f83d6f59 (diff) | |
download | mitmproxy-c11ab3676dee2a490994665e867bcfcb26945777.tar.gz mitmproxy-c11ab3676dee2a490994665e867bcfcb26945777.tar.bz2 mitmproxy-c11ab3676dee2a490994665e867bcfcb26945777.zip |
Merge branch 'http-models'
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r-- | libmproxy/protocol/http.py | 6 | ||||
-rw-r--r-- | libmproxy/protocol/tls.py | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 34bccaf8..50765e50 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -54,7 +54,7 @@ class _StreamingHttpLayer(_HttpLayer): def read_response(self, request): response = self.read_response_headers() - response.body = b"".join( + response.content = b"".join( self.read_response_body(request, response) ) return response @@ -66,10 +66,10 @@ class _StreamingHttpLayer(_HttpLayer): raise NotImplementedError() def send_response(self, response): - if response.body == CONTENT_MISSING: + if response.content == CONTENT_MISSING: raise HttpException("Cannot assemble flow with CONTENT_MISSING") self.send_response_headers(response) - self.send_response_body(response, [response.body]) + self.send_response_body(response, [response.content]) class Http1Layer(_StreamingHttpLayer): diff --git a/libmproxy/protocol/tls.py b/libmproxy/protocol/tls.py index d144e081..9764fb22 100644 --- a/libmproxy/protocol/tls.py +++ b/libmproxy/protocol/tls.py @@ -7,7 +7,6 @@ from construct import ConstructError import six from netlib.exceptions import InvalidCertificateException, TcpException, TlsException -from netlib.http import ALPN_PROTO_HTTP1 from ..contrib.tls._constructs import ClientHello from ..exceptions import ProtocolException, TlsProtocolException, ClientHandshakeException from .base import Layer @@ -367,8 +366,8 @@ class TlsLayer(Layer): """ # This gets triggered if we haven't established an upstream connection yet. - default_alpn = ALPN_PROTO_HTTP1 - # alpn_preference = ALPN_PROTO_H2 + default_alpn = b'http/1.1' + # alpn_preference = b'h2' if self.alpn_for_client_connection in options: choice = bytes(self.alpn_for_client_connection) |