Skip to content

Commit 2deab27

Browse files
committed
fix(path_utils): include combined extensions
previously it didnt care about tar.gz and thinks it is only gz, now it shouldnt do that
1 parent 0daa941 commit 2deab27

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/rovr/functions/path.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,11 @@ def get_mime_type(
564564
if ignore is None:
565565
ignore = ()
566566

567-
file_extension = path.splitext(file_path)[1].lower()
567+
base = path.basename(file_path)
568+
if base.startswith("."):
569+
file_extension = base[1:]
570+
else:
571+
file_extension = "".join(base.split(".")[1:]).lower()
568572

569573
# Read file bytes once, reuse for both puremagic and basic detection
570574
try:

0 commit comments

Comments
 (0)