diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-06-30 14:30:48 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-06-30 14:30:48 +1200 |
commit | 37c8d3425da3f53eda34065c34df62684641d380 (patch) | |
tree | 09f503bb1d741ceb90e69401c3d2887d76d0d481 /libmproxy/console.py | |
parent | 18d4c3a9e96fad9683b87e2202a078722291a72b (diff) | |
download | mitmproxy-37c8d3425da3f53eda34065c34df62684641d380.tar.gz mitmproxy-37c8d3425da3f53eda34065c34df62684641d380.tar.bz2 mitmproxy-37c8d3425da3f53eda34065c34df62684641d380.zip |
Fix edit prompt display, return code editing.
Diffstat (limited to 'libmproxy/console.py')
-rw-r--r-- | libmproxy/console.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libmproxy/console.py b/libmproxy/console.py index 4ae1f23a..864cba23 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -372,7 +372,10 @@ class ConnectionView(WWrap): def set_resp_code(self, code): response = self.flow.response - response.code = code + try: + response.code = int(code) + except ValueError: + return None import BaseHTTPServer if BaseHTTPServer.BaseHTTPRequestHandler.responses.has_key(int(code)): response.msg = BaseHTTPServer.BaseHTTPRequestHandler.responses[int(code)][0] @@ -403,7 +406,7 @@ class ConnectionView(WWrap): elif part == "m" and self.state.view_flow_mode == VIEW_FLOW_REQUEST: self.master.prompt_onekey("Method", self.methods, self.edit_method) elif part == "c" and self.state.view_flow_mode == VIEW_FLOW_RESPONSE: - self.master.prompt_edit("Code", conn.code, self.set_resp_code) + self.master.prompt_edit("Code", str(conn.code), self.set_resp_code) elif part == "m" and self.state.view_flow_mode == VIEW_FLOW_RESPONSE: self.master.prompt_edit("Message", conn.msg, self.set_resp_msg) elif part == "r" and self.state.view_flow_mode == VIEW_FLOW_REQUEST: @@ -1290,7 +1293,7 @@ class ConsoleMaster(flow.FlowMaster): self.prompting = (callback, args) def prompt_edit(self, prompt, text, callback): - self.statusbar.prompt(prompt, text) + self.statusbar.prompt(prompt + ": ", text) self.view.set_focus("footer") self.prompting = (callback, []) |