diff options
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. |