diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-07-24 21:38:28 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-07-24 21:38:28 +1200 |
commit | 94b491bb277054af106f63e2e2b9cec6b9ca6d3c (patch) | |
tree | d77084ed160c7a3128d728d95fc9626bb9b64ce4 /libpathod/pathoc.py | |
parent | 9502eeadaa8463019059137584a75597e20a5544 (diff) | |
download | mitmproxy-94b491bb277054af106f63e2e2b9cec6b9ca6d3c.tar.gz mitmproxy-94b491bb277054af106f63e2e2b9cec6b9ca6d3c.tar.bz2 mitmproxy-94b491bb277054af106f63e2e2b9cec6b9ca6d3c.zip |
Add a Host header to pathoc requests by default.
Diffstat (limited to 'libpathod/pathoc.py')
-rw-r--r-- | libpathod/pathoc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index 8fe7b7f6..b78d986f 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -20,7 +20,7 @@ class Pathoc(tcp.TCPClient): tcp.TCPClient.__init__(self, host, port) self.settings = dict( staticdir = os.getcwd(), - unconstrained_file_access = True + unconstrained_file_access = True, ) def request(self, spec): @@ -31,7 +31,7 @@ class Pathoc(tcp.TCPClient): rparse.FileAccessDenied. """ r = rparse.parse_request(self.settings, spec) - ret = r.serve(self.wfile) + ret = r.serve(self.wfile, None, self.host) self.wfile.flush() return http.read_response(self.rfile, r.method, None) @@ -43,7 +43,7 @@ class Pathoc(tcp.TCPClient): for i in reqs: try: r = rparse.parse_request(self.settings, i) - req = r.serve(self.wfile) + req = r.serve(self.wfile, None, self.host) if reqdump: print >> fp, "\n>>", req["method"], repr(req["path"]) for a in req["actions"]: |