aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/app.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-10-30 13:36:32 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-10-30 13:36:32 +1300
commit677f0e0580f92d1244285b9f0481c3ace3b14ee1 (patch)
tree59ed047bace6e0da17f9fd951411b73aa2bbf50d /libpathod/app.py
parenta1f782b543567ce2e88cd8b5defae64b3cbc89d3 (diff)
downloadmitmproxy-677f0e0580f92d1244285b9f0481c3ace3b14ee1.tar.gz
mitmproxy-677f0e0580f92d1244285b9f0481c3ace3b14ee1.tar.bz2
mitmproxy-677f0e0580f92d1244285b9f0481c3ace3b14ee1.zip
Change preview_safe to return a safe copy of the current message.
Diffstat (limited to 'libpathod/app.py')
-rw-r--r--libpathod/app.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/libpathod/app.py b/libpathod/app.py
index 38d0be33..e073921c 100644
--- a/libpathod/app.py
+++ b/libpathod/app.py
@@ -108,7 +108,6 @@ def _preview(is_request):
section = "main",
syntaxerror = None,
error = None,
- pauses = None
)
if not spec.strip():
args["error"] = "Can't parse an empty spec."
@@ -125,16 +124,16 @@ def _preview(is_request):
return render(template, False, **args)
s = cStringIO.StringIO()
- args["pauses"] = r.preview_safe()
+ safe = r.preview_safe()
- c = app.config["pathod"].check_policy(r, app.config["pathod"].request_settings)
+ c = app.config["pathod"].check_policy(safe, app.config["pathod"].request_settings)
if c:
args["error"] = c
return render(template, False, **args)
if is_request:
- r.serve(s, app.config["pathod"].request_settings, host="example.com")
+ safe.serve(s, app.config["pathod"].request_settings, host="example.com")
else:
- r.serve(s, app.config["pathod"].request_settings)
+ safe.serve(s, app.config["pathod"].request_settings)
args["output"] = utils.escape_unprintables(s.getvalue())
return render(template, False, **args)