From 6bc1755750f8a7986ab26ff28ea0e90ad0ccaacd Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 2 Feb 2016 12:32:58 +0100 Subject: add comment that explains OrderedDict use --- libmproxy/models/http.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libmproxy/models') diff --git a/libmproxy/models/http.py b/libmproxy/models/http.py index a52597b4..8a0b226d 100644 --- a/libmproxy/models/http.py +++ b/libmproxy/models/http.py @@ -14,6 +14,10 @@ from .flow import Flow from collections import OrderedDict class MessageMixin(stateobject.StateObject): + # 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, -- cgit v1.2.3