File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -578,11 +578,11 @@ def write_assets(
578
578
options = {}
579
579
# TODO: We should treat the directory parameter as an actual directory. (Open-EO/openeo-geopyspark-driver#888)
580
580
filename = str (directory )
581
- directory = Path (filename ).parent
581
+ directory_parent = Path (filename ).parent
582
582
583
583
format_info = IOFORMATS .get (format )
584
584
# 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 } "
586
586
587
587
if format_info .format == "JSON" :
588
588
# TODO: eliminate this legacy format?
@@ -607,7 +607,7 @@ def write_assets(
607
607
}}
608
608
else :
609
609
# Multi-file format
610
- components = list (directory .glob ("vectorcube.*" ))
610
+ components = list (directory_parent .glob ("vectorcube.*" ))
611
611
if options .get ("zip_multi_file" ):
612
612
# TODO: automatically zip shapefile components?
613
613
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:
205
205
asset = assets .popitem ()[1 ]
206
206
path = Path (asset ["href" ])
207
207
mimetype = asset .get ("type" )
208
+ assert path .relative_to (tmp_dir )
208
209
return send_from_directory (path .parent , path .name , mimetype = mimetype )
209
210
210
211
You can’t perform that action at this time.
0 commit comments