File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 88from werkzeug .utils import secure_filename
99
1010import murfey .server .prometheus as prom
11- from murfey .util import safe_run , sanitise
11+ from murfey .util import safe_run , sanitise , secure_path
1212from murfey .util .config import MachineConfig , from_file , get_machine_config , settings
1313from murfey .util .db import (
1414 DataCollection ,
@@ -207,20 +207,23 @@ def gather_upstream_files(
207207 if file .is_file ():
208208 file_list .append (file )
209209 logger .info (
210- f"Found { len (file_list )} files for download from { upstream_instrument } "
210+ f"Found { len (file_list )} files for download "
211+ f"from { sanitise (upstream_instrument )} "
211212 )
212213 else :
213214 logger .warning (
214- f"Upstream file searching has not been configured for { upstream_instrument } on { instrument_name } "
215+ "Upstream file searching has not been configured for "
216+ f"{ sanitise (upstream_instrument )} on { sanitise (instrument_name )} "
215217 )
216218 return file_list
217219
218220
219221def get_upstream_file (file_path : str | Path ):
220222 file_path = Path (file_path ) if isinstance (file_path , str ) else file_path
223+ file_path = secure_path (file_path )
221224 if file_path .exists () and file_path .is_file ():
222225 return file_path
223- logger .warning (f"Requested file { str (file_path )!r} was not found" )
226+ logger .warning (f"Requested file { sanitise ( str (file_path ) )!r} was not found" )
224227 return None
225228
226229
You can’t perform that action at this time.
0 commit comments