diff options
author | Henrik Nordstrom <henrik@henriknordstrom.ne> | 2010-11-12 15:49:25 +0100 |
---|---|---|
committer | Henrik Nordstrom <henrik@henriknordstrom.net> | 2011-02-10 02:59:51 +0100 |
commit | 2d8cfbafc32b4bcae288af1e0d9929c0b5427652 (patch) | |
tree | b636aa0a83911513cbea4e1f7d1e0a80b51213b8 /libmproxy | |
parent | eb3b32f01c167d6a77068215c72d4c1d487cdd17 (diff) | |
download | mitmproxy-2d8cfbafc32b4bcae288af1e0d9929c0b5427652.tar.gz mitmproxy-2d8cfbafc32b4bcae288af1e0d9929c0b5427652.tar.bz2 mitmproxy-2d8cfbafc32b4bcae288af1e0d9929c0b5427652.zip |
Automatically update response message when editing response code
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/console.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libmproxy/console.py b/libmproxy/console.py index 17c14580..7e95d260 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -412,6 +412,9 @@ class ConnectionView(WWrap): def set_resp_code(self, code): response = self.flow.response response.code = code + import BaseHTTPServer + if BaseHTTPServer.BaseHTTPRequestHandler.responses.has_key(int(code)): + response.msg = BaseHTTPServer.BaseHTTPRequestHandler.responses[int(code)][0] self.master.refresh_connection(self.flow) def set_resp_msg(self, msg): @@ -1309,8 +1312,7 @@ class ConsoleMaster(controller.Master): if not f: r.ack() else: - self.sync_list_view() - self.refresh_connection(f) + self.process_flow(f, r) def handle_request(self, r): f = self.state.add_request(r) |