File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -578,11 +578,11 @@ def write_assets(
578578 options = {}
579579 # TODO: We should treat the directory parameter as an actual directory. (Open-EO/openeo-geopyspark-driver#888)
580580 filename = str (directory )
581- directory = Path (filename ).parent
581+ directory_parent = Path (filename ).parent
582582
583583 format_info = IOFORMATS .get (format )
584584 # TODO: check if format can be used for vector data?
585- path = directory / f"vectorcube.{ format_info .extension } "
585+ path = directory_parent / f"vectorcube.{ format_info .extension } "
586586
587587 if format_info .format == "JSON" :
588588 # TODO: eliminate this legacy format?
@@ -607,7 +607,7 @@ def write_assets(
607607 }}
608608 else :
609609 # Multi-file format
610- components = list (directory .glob ("vectorcube.*" ))
610+ components = list (directory_parent .glob ("vectorcube.*" ))
611611 if options .get ("zip_multi_file" ):
612612 # TODO: automatically zip shapefile components?
613613 zip_path = path .with_suffix (f".{ format_info .extension } .zip" )
Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ def create_flask_response(self) -> Response:
205205 asset = assets .popitem ()[1 ]
206206 path = Path (asset ["href" ])
207207 mimetype = asset .get ("type" )
208+ assert path .relative_to (tmp_dir )
208209 return send_from_directory (path .parent , path .name , mimetype = mimetype )
209210
210211
You can’t perform that action at this time.
0 commit comments