From aecd4d97e718cbce9c2afe2bd2dd45f99f0c4571 Mon Sep 17 00:00:00 2001 From: Idan Miara Date: Thu, 27 Aug 2020 12:13:27 +0300 Subject: [PATCH] pywps/inout/basic.py, pywps/app/Service.py - replace ':' with os.pathsep (colon on Linux, semicolon on Windows) to allow path list separation also on Windows with full paths that include colon (i.e.. c:\maps) --- pywps/app/Service.py | 2 +- pywps/inout/basic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pywps/app/Service.py b/pywps/app/Service.py index 6263849e5..3f3401778 100755 --- a/pywps/app/Service.py +++ b/pywps/app/Service.py @@ -378,7 +378,7 @@ def _validate_file_input(href): file_path = os.path.abspath(file_path) # build allowed paths list inputpaths = config.get_config_value('server', 'allowedinputpaths') - allowed_paths = [os.path.abspath(p.strip()) for p in inputpaths.split(':') if p.strip()] + allowed_paths = [os.path.abspath(p.strip()) for p in inputpaths.split(os.pathsep) if p.strip()] for allowed_path in allowed_paths: if file_path.startswith(allowed_path): LOGGER.debug("Accepted file url as input.") diff --git a/pywps/inout/basic.py b/pywps/inout/basic.py index 814934b78..2be73a45f 100644 --- a/pywps/inout/basic.py +++ b/pywps/inout/basic.py @@ -932,7 +932,7 @@ def _validate_file_input(href): file_path = os.path.abspath(file_path) # build allowed paths list inputpaths = config.get_config_value('server', 'allowedinputpaths') - allowed_paths = [os.path.abspath(p.strip()) for p in inputpaths.split(':') if p.strip()] + allowed_paths = [os.path.abspath(p.strip()) for p in inputpaths.split(os.pathsep) if p.strip()] for allowed_path in allowed_paths: if file_path.startswith(allowed_path): LOGGER.debug("Accepted file url as input.")