Skip to content

Commit f2da9ef

Browse files
committed
fix: ensure src_url.path is valid before guessing MIME type in check_need_unzipping
1 parent 15170c1 commit f2da9ef

File tree

1 file changed

+2
-1
lines changed
  • services/dask-sidecar/src/simcore_service_dask_sidecar/utils

1 file changed

+2
-1
lines changed

services/dask-sidecar/src/simcore_service_dask_sidecar/utils/files.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def check_need_unzipping(
150150
Checks if the source URL points to a zip file and if the target mime type is not zip.
151151
If so, extraction is needed.
152152
"""
153-
src_mime_type, _ = mimetypes.guess_type(f"{src_url.path}")
153+
assert src_url.path # nosec
154+
src_mime_type, _ = mimetypes.guess_type(src_url.path)
154155
dst_mime_type = target_mime_type
155156
if not dst_mime_type:
156157
dst_mime_type, _ = mimetypes.guess_type(dst_path)

0 commit comments

Comments
 (0)