From 493cecfaf27f7680c8acaaa88a467fc016a00bf8 Mon Sep 17 00:00:00 2001 From: Marcelo Glezer Date: Wed, 11 Feb 2015 16:05:49 -0300 Subject: renamed add_request to create_request and added a tiny docstring --- libmproxy/console/flowlist.py | 2 +- libmproxy/flow.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libmproxy/console/flowlist.py b/libmproxy/console/flowlist.py index 8dfaba95..7d511682 100644 --- a/libmproxy/console/flowlist.py +++ b/libmproxy/console/flowlist.py @@ -267,7 +267,7 @@ class FlowListBox(urwid.ListBox): def new_request(self, url, method): try: scheme, host, port, path = http.parse_url(url) - f = self.master.add_request(method, scheme, host, port, path) + f = self.master.create_request(method, scheme, host, port, path) self.master.view_flow(f) except ValueError: self.master.statusbar.message("Invalid Url") diff --git a/libmproxy/flow.py b/libmproxy/flow.py index e9d90916..42fc36cc 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -763,7 +763,13 @@ class FlowMaster(controller.Master): def duplicate_flow(self, f): return self.load_flow(f.copy()) - def add_request(self, method, scheme, host, port, path): + def create_request(self, method, scheme, host, port, path): + """ + Creates a new request from params and add it to flow list. + created request is empty (except for method and url) but is able + to be replayed + + """ f = http.HTTPFlow(None,None); headers = ODictCaseless() -- cgit v1.2.3