From 94b491bb277054af106f63e2e2b9cec6b9ca6d3c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 24 Jul 2012 21:38:28 +1200 Subject: Add a Host header to pathoc requests by default. --- libpathod/pathoc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libpathod/pathoc.py') 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"]: -- cgit v1.2.3