aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/common.py
diff options
context:
space:
mode:
authorMarcelo Glezer <mg@tekii.com.ar>2015-01-16 12:13:55 -0300
committerMarcelo Glezer <mg@tekii.com.ar>2015-02-05 11:31:24 -0300
commit9fc68d320c80ad07398a234630f6b59546a444e0 (patch)
tree9d13754d43318df132c78eff004dd80aa99d3ada /libmproxy/console/common.py
parent3bcf0cbba894ad12d4cfc438d26cdf22d640416c (diff)
downloadmitmproxy-9fc68d320c80ad07398a234630f6b59546a444e0.tar.gz
mitmproxy-9fc68d320c80ad07398a234630f6b59546a444e0.tar.bz2
mitmproxy-9fc68d320c80ad07398a234630f6b59546a444e0.zip
added support for copying request (content|header) to clipboard
Diffstat (limited to 'libmproxy/console/common.py')
-rw-r--r--libmproxy/console/common.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py
index 29e59373..33738c0a 100644
--- a/libmproxy/console/common.py
+++ b/libmproxy/console/common.py
@@ -181,7 +181,7 @@ def save_body(path, master, state, content):
def ask_save_body(k, master, state, content):
if k == "y":
master.path_prompt(
- "Save response body: ",
+ "Save message content: ",
state.last_saveload,
save_body,
master,
@@ -189,12 +189,12 @@ def ask_save_body(k, master, state, content):
content,
)
-## common server_copy_response parts
-def server_copy_response( k, master, state, response):
+## common copy_message parts
+def copy_message( k, master, state, message):
if pyperclip:
if k == "c":
try:
- pyperclip.copy(response.get_decoded_content())
+ pyperclip.copy(message.get_decoded_content())
except TypeError:
master.prompt_onekey(
"Content is binary do you want to save it to a file instead?",
@@ -205,17 +205,16 @@ def server_copy_response( k, master, state, response):
ask_save_body,
master,
state,
- response.get_decoded_content(),
+ message.get_decoded_content(),
)
elif k == "h":
try:
- pyperclip.copy(str(response.headers))
+ pyperclip.copy(str(message.headers))
except TypeError:
master.statusbar.message("Error converting headers to text")
else:
master.statusbar.message("No clipboard support on your system, sorry.")
-
class FlowCache:
@utils.LRUCache(200)
def format_flow(self, *args):