diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-02-04 10:51:18 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-02-04 10:51:18 +0100 |
commit | 023026e032f7f78a53a598eb7bd130d1b14930d2 (patch) | |
tree | 01982db6659f75f2bfe737a81b82022550e48e28 /libmproxy/models/http.py | |
parent | ae4a1dd6dec9d95e450837db8937e3fb7604c121 (diff) | |
parent | 98f54d21b6156ceaa8450072be9f53dfde137248 (diff) | |
download | mitmproxy-023026e032f7f78a53a598eb7bd130d1b14930d2.tar.gz mitmproxy-023026e032f7f78a53a598eb7bd130d1b14930d2.tar.bz2 mitmproxy-023026e032f7f78a53a598eb7bd130d1b14930d2.zip |
Merge pull request #883 from mitmproxy/hyper-h2
HTTP/2: Implementation using hyper-h2
Diffstat (limited to 'libmproxy/models/http.py')
-rw-r--r-- | libmproxy/models/http.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libmproxy/models/http.py b/libmproxy/models/http.py index e07dff69..8a0b226d 100644 --- a/libmproxy/models/http.py +++ b/libmproxy/models/http.py @@ -11,9 +11,14 @@ from netlib.tcp import Address from .. import version, stateobject from .flow import Flow +from collections import OrderedDict class MessageMixin(stateobject.StateObject): - _stateobject_attributes = dict( + # The restoration order is important currently, e.g. because + # of .content setting .headers["content-length"] automatically. + # Using OrderedDict is the short term fix, restoring state should + # be implemented without side-effects again. + _stateobject_attributes = OrderedDict( http_version=bytes, headers=Headers, timestamp_start=float, @@ -241,8 +246,6 @@ class HTTPRequest(MessageMixin, Request): timestamp_end=request.timestamp_end, form_out=(request.form_out if hasattr(request, 'form_out') else None), ) - if hasattr(request, 'stream_id'): - req.stream_id = request.stream_id return req def __hash__(self): @@ -347,8 +350,6 @@ class HTTPResponse(MessageMixin, Response): timestamp_start=response.timestamp_start, timestamp_end=response.timestamp_end, ) - if hasattr(response, 'stream_id'): - resp.stream_id = response.stream_id return resp def _refresh_cookie(self, c, delta): |