From a8864e2abdc6141a6681da0590c505e9ae7ffa5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=BChl?= Date: Wed, 28 Apr 2021 15:54:19 +0700 Subject: [PATCH] Detect rar archives by mime type RAR archives might not have .rar extension, see [Wikipedia](https://en.wikipedia.org/wiki/RAR_(file_format)) --- weed/util/compression.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/util/compression.go b/weed/util/compression.go index 9d52810cb..c41dbbeab 100644 --- a/weed/util/compression.go +++ b/weed/util/compression.go @@ -147,6 +147,9 @@ func IsZstdContent(data []byte) bool { if strings.HasSuffix(mtype, "script") { return true, true } + if strings.HasSuffix(mtype, "vnd.rar) { + return false, true + } } if strings.HasPrefix(mtype, "audio/") {