diff options
| author | Tobias Mühl <tobiasmuehl@users.noreply.github.com> | 2021-04-28 15:54:19 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-28 15:54:19 +0700 |
| commit | a8864e2abdc6141a6681da0590c505e9ae7ffa5d (patch) | |
| tree | 61485a712451cd9eeacfae4be143e5ed28202be7 /weed/util/compression.go | |
| parent | ccbe02218a5cb22fed0fb620ea392180c9155acd (diff) | |
| download | seaweedfs-a8864e2abdc6141a6681da0590c505e9ae7ffa5d.tar.xz seaweedfs-a8864e2abdc6141a6681da0590c505e9ae7ffa5d.zip | |
Detect rar archives by mime type
RAR archives might not have .rar extension, see [Wikipedia](https://en.wikipedia.org/wiki/RAR_(file_format))
Diffstat (limited to 'weed/util/compression.go')
| -rw-r--r-- | weed/util/compression.go | 3 |
1 files changed, 3 insertions, 0 deletions
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/") { |
