diff options
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/console/__init__.py | 3 | ||||
-rw-r--r-- | libmproxy/console/flowlist.py | 6 | ||||
-rw-r--r-- | libmproxy/console/flowview.py | 2 | ||||
-rw-r--r-- | libmproxy/flow.py | 3 | ||||
-rw-r--r-- | libmproxy/protocol/http.py | 12 |
5 files changed, 13 insertions, 13 deletions
diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index ffd9eda8..fc6600c1 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -516,7 +516,8 @@ class ConsoleMaster(flow.FlowMaster): self.start_server_playback( ret, self.killextra, self.rheaders, - False, self.nopop + False, self.nopop, + self.options.replay_ignore_params, self.options.replay_ignore_content ) def spawn_editor(self, data): diff --git a/libmproxy/console/flowlist.py b/libmproxy/console/flowlist.py index e0330171..3eb4eb1a 100644 --- a/libmproxy/console/flowlist.py +++ b/libmproxy/console/flowlist.py @@ -120,13 +120,15 @@ class ConnectionItem(common.WWrap): self.master.start_server_playback( [i.copy() for i in self.master.state.view], self.master.killextra, self.master.rheaders, - False, self.master.nopop + False, self.master.nopop, + self.master.options.replay_ignore_params, self.master.options.replay_ignore_content ) elif k == "t": self.master.start_server_playback( [self.flow.copy()], self.master.killextra, self.master.rheaders, - False, self.master.nopop + False, self.master.nopop, + self.master.options.replay_ignore_params, self.master.options.replay_ignore_content ) else: self.master.path_prompt( diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py index b2c46147..3dceff70 100644 --- a/libmproxy/console/flowview.py +++ b/libmproxy/console/flowview.py @@ -749,7 +749,7 @@ class FlowView(common.WWrap): self.master.statusbar.message("") elif key == "m": p = list(contentview.view_prompts) - p.insert(0, ("clear", "c")) + p.insert(0, ("Clear", "C")) self.master.prompt_onekey( "Display mode", p, diff --git a/libmproxy/flow.py b/libmproxy/flow.py index bd35e864..1826af3d 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -192,6 +192,7 @@ class ClientPlaybackState: """ if self.flows and not self.current: n = self.flows.pop(0) + n.response = None n.reply = controller.DummyReply() self.current = master.handle_request(n) if not testing and not self.current.response: @@ -615,7 +616,7 @@ class FlowMaster(controller.Master): ] if all(e): self.shutdown() - self.client_playback.tick(self, timeout) + self.client_playback.tick(self) return controller.Master.tick(self, q, timeout) diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 1472f2ca..c8974d25 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -434,11 +434,9 @@ class HTTPRequest(HTTPMessage): self.host, self.port)] - if self.content: + # If content is defined (i.e. not None or CONTENT_MISSING), we always add a content-length header. + if self.content or self.content == "": headers["Content-Length"] = [str(len(self.content))] - elif 'Transfer-Encoding' in self.headers: - # content-length for e.g. chuncked transfer-encoding with no content - headers["Content-Length"] = ["0"] return str(headers) @@ -761,11 +759,9 @@ class HTTPResponse(HTTPMessage): if not preserve_transfer_encoding: del headers['Transfer-Encoding'] - if self.content: + # If content is defined (i.e. not None or CONTENT_MISSING), we always add a content-length header. + if self.content or self.content == "": headers["Content-Length"] = [str(len(self.content))] - # add content-length for chuncked transfer-encoding with no content - elif not preserve_transfer_encoding and 'Transfer-Encoding' in self.headers: - headers["Content-Length"] = ["0"] return str(headers) |