diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-01-28 17:44:55 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-01-28 17:44:55 +0100 |
commit | 1b566869de4d07d509fa2ead6b91486326a9e5a4 (patch) | |
tree | 8e776fec3323ab0db96a895ebc684606457209d6 /libpathod/pathod.py | |
parent | f83508d4bf313710de8afa204aaf9be227cf812c (diff) | |
parent | ea894282f3a659cbb9466ce235c21f53f002ac3a (diff) | |
download | mitmproxy-1b566869de4d07d509fa2ead6b91486326a9e5a4.tar.gz mitmproxy-1b566869de4d07d509fa2ead6b91486326a9e5a4.tar.bz2 mitmproxy-1b566869de4d07d509fa2ead6b91486326a9e5a4.zip |
Merge branch 'master' into tcp_proxy
Diffstat (limited to 'libpathod/pathod.py')
-rw-r--r-- | libpathod/pathod.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libpathod/pathod.py b/libpathod/pathod.py index 39de1b7b..5433805f 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -1,5 +1,5 @@ -import urllib, threading, re, logging, socket, sys, base64 -from netlib import tcp, http, odict, wsgi, certutils +import urllib, threading, re, logging +from netlib import tcp, http, wsgi, certutils import netlib.utils import version, app, language, utils @@ -158,13 +158,13 @@ class PathodHandler(tcp.BaseHandler): cc = wsgi.ClientConn(self.client_address) req = wsgi.Request(cc, "http", method, path, headers, content) sn = self.connection.getsockname() - app = wsgi.WSGIAdaptor( + a = wsgi.WSGIAdaptor( self.server.app, sn[0], self.server.port, version.NAMEVERSION ) - app.serve(req, self.wfile) + a.serve(req, self.wfile) return True, None def _log_bytes(self, header, data, hexdump): @@ -257,7 +257,7 @@ class Pathod(tcp.TCPServer): except re.error: raise PathodError("Invalid regex in anchor: %s"%i[0]) try: - aresp = language.parse_response(self.request_settings, i[1]) + language.parse_response(self.request_settings, i[1]) except language.ParseException, v: raise PathodError("Invalid page spec in anchor: '%s', %s"%(i[1], str(v))) self.anchors.append((arex, i[1])) @@ -268,7 +268,7 @@ class Pathod(tcp.TCPServer): """ try: l = req.maximum_length(settings) - except language.FileAccessDenied, v: + except language.FileAccessDenied: return "File access denied." if self.sizelimit and l > self.sizelimit: return "Response too large." |