aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-07-27 14:03:15 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-07-27 14:03:15 +1200
commitd8c53cbc57574bfce0be617d36e7ccf6f1b55885 (patch)
tree22c4a6f033cb27fe808297afc38331ca35387090 /libpathod
parent3e158211a830bbcba2dd463189a79ec3ad17c8d4 (diff)
downloadmitmproxy-d8c53cbc57574bfce0be617d36e7ccf6f1b55885.tar.gz
mitmproxy-d8c53cbc57574bfce0be617d36e7ccf6f1b55885.tar.bz2
mitmproxy-d8c53cbc57574bfce0be617d36e7ccf6f1b55885.zip
Add an option to specify a log file to pathod.
Diffstat (limited to 'libpathod')
-rw-r--r--libpathod/pathod.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpathod/pathod.py b/libpathod/pathod.py
index b1343ea2..0ae32c47 100644
--- a/libpathod/pathod.py
+++ b/libpathod/pathod.py
@@ -81,18 +81,22 @@ class PathodHandler(tcp.BaseHandler):
for i in self.server.anchors:
if i[0].match(path):
+ self.info("Serving anchor: %s"%path)
return self.serve_crafted(i[1], request_log)
if not self.server.nocraft and path.startswith(self.server.craftanchor):
spec = urllib.unquote(path)[len(self.server.craftanchor):]
+ self.info("Serving spec: %s"%spec)
try:
crafted = rparse.parse_response(self.server.request_settings, spec)
except rparse.ParseException, v:
+ self.info("Parse error: %s"%v.msg)
crafted = rparse.PathodErrorResponse(
"Parse Error",
"Error parsing response spec: %s\n"%v.msg + v.marked()
)
except rparse.FileAccessDenied:
+ self.info("File access denied")
crafted = rparse.PathodErrorResponse("Access Denied")
return self.serve_crafted(crafted, request_log)
elif self.server.noweb:
@@ -100,6 +104,7 @@ class PathodHandler(tcp.BaseHandler):
crafted.serve(self.wfile, self.server.check_policy)
return False
else:
+ self.info("app: %s %s"%(method, path))
cc = wsgi.ClientConn(self.client_address)
req = wsgi.Request(cc, "http", method, path, headers, content)
sn = self.connection.getsockname()
@@ -110,7 +115,6 @@ class PathodHandler(tcp.BaseHandler):
version.NAMEVERSION
)
app.serve(req, self.wfile)
- self.debug("%s %s"%(method, path))
return True
def handle(self):