diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-05-02 16:53:48 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-05-02 16:53:48 +1200 |
commit | 5b48c69a6a0f1eeac9e8981d59d556e565163fba (patch) | |
tree | a9973c7ab90bccaa3ebd7d463e6fbab62e75a77a /libpathod | |
parent | 9109b3cc8cca05f34d3ddee062cf7f8bc401af31 (diff) | |
download | mitmproxy-5b48c69a6a0f1eeac9e8981d59d556e565163fba.tar.gz mitmproxy-5b48c69a6a0f1eeac9e8981d59d556e565163fba.tar.bz2 mitmproxy-5b48c69a6a0f1eeac9e8981d59d556e565163fba.zip |
Split language test suite: generators
Also remove some unused code
Diffstat (limited to 'libpathod')
-rw-r--r-- | libpathod/language/base.py | 16 | ||||
-rw-r--r-- | libpathod/pathoc.py | 6 |
2 files changed, 4 insertions, 18 deletions
diff --git a/libpathod/language/base.py b/libpathod/language/base.py index 407d5473..6de8c086 100644 --- a/libpathod/language/base.py +++ b/libpathod/language/base.py @@ -733,19 +733,3 @@ class _Message(object): Sep = pp.Optional(pp.Literal(":")).suppress() - - -def read_file(settings, s): - uf = settings.get("unconstrained_file_access") - sd = settings.get("staticdir") - if not sd: - raise exceptions.FileAccessDenied("File access disabled.") - sd = os.path.normpath(os.path.abspath(sd)) - s = s[1:] - s = os.path.expanduser(s) - s = os.path.normpath(os.path.abspath(os.path.join(sd, s))) - if not uf and not s.startswith(sd): - raise exceptions.FileAccessDenied("File access outside of configured directory") - if not os.path.isfile(s): - raise exceptions.FileAccessDenied("File not readable") - return file(s, "rb").read() diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index e874412d..53ba4447 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -347,7 +347,8 @@ class Pathoc(tcp.TCPClient): """ Performs a single request. - r: A language.http.Request object, or a string representing one request. + r: A language.http.Request object, or a string representing one + request. Returns Response if we have a non-ignored response. @@ -386,7 +387,8 @@ class Pathoc(tcp.TCPClient): """ Performs a single request. - r: A language.http.Request object, or a string representing one request. + r: A language.http.Request object, or a string representing one + request. Returns Response if we have a non-ignored response. |