diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-22 15:49:17 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-22 15:49:17 +1200 |
commit | 99cb0808abfa3bd5bbc8d19c10756641c032dc48 (patch) | |
tree | f93b7a76f878eb17d5ef97787c01202559d70dc2 /libpathod/pathoc.py | |
parent | 65f04bf4d103ea7ab9307946ccc11a17de51d93f (diff) | |
download | mitmproxy-99cb0808abfa3bd5bbc8d19c10756641c032dc48.tar.gz mitmproxy-99cb0808abfa3bd5bbc8d19c10756641c032dc48.tar.bz2 mitmproxy-99cb0808abfa3bd5bbc8d19c10756641c032dc48.zip |
websockets: server handshake scheme
Also refactor settings and resolution interfaces
Diffstat (limited to 'libpathod/pathoc.py')
-rw-r--r-- | libpathod/pathoc.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index 0d8ec8f9..cf9be5b9 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -108,9 +108,10 @@ class Pathoc(tcp.TCPClient): ignorecodes: Sequence of return codes to ignore """ tcp.TCPClient.__init__(self, address) - self.settings = dict( + self.settings = language.Settings( staticdir = os.getcwd(), unconstrained_file_access = True, + request_host = self.address.host ) self.ssl, self.sni = ssl, sni self.clientcert = clientcert @@ -201,15 +202,14 @@ class Pathoc(tcp.TCPClient): if self.showresp: self.rfile.start_log() try: - req = language.serve( - r, - self.wfile, - self.settings, - request_host = self.address.host - ) + req = language.serve(r, self.wfile, self.settings) self.wfile.flush() resp = list( - http.read_response(self.rfile, r.method.string(), None) + http.read_response( + self.rfile, + req["method"], + None + ) ) resp.append(self.sslinfo) resp = Response(*resp) @@ -290,7 +290,7 @@ def main(args): # pragma: nocover ) if args.explain or args.memo: playlist = [ - i.freeze(p.settings, request_host=p.address.host) for i in playlist + i.freeze(p.settings) for i in playlist ] if args.memo: newlist = [] |