diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2020-01-29 22:37:35 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-29 22:37:35 -0800 |
| commit | 3b043ead49574ec7b9972a7d689186de17dda70f (patch) | |
| tree | 39143ae111d6585a69290552e5bbd04abe38189d | |
| parent | abf90ad7b794b37672e68dd7b10689c5b3b41e29 (diff) | |
| parent | 2a870875901d0ce1269e644bbf02056d5d7e848f (diff) | |
| download | seaweedfs-3b043ead49574ec7b9972a7d689186de17dda70f.tar.xz seaweedfs-3b043ead49574ec7b9972a7d689186de17dda70f.zip | |
Merge pull request #1189 from eryx67/compression-wav
Support wav files compression
| -rw-r--r-- | weed/util/compression.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/weed/util/compression.go b/weed/util/compression.go index c6c9423e2..6072df632 100644 --- a/weed/util/compression.go +++ b/weed/util/compression.go @@ -60,7 +60,7 @@ func UnGzipData(input []byte) ([]byte, error) { // images switch ext { - case ".svg", ".bmp": + case ".svg", ".bmp", ".wav": return true, true } if strings.HasPrefix(mtype, "image/") { @@ -87,6 +87,14 @@ func UnGzipData(input []byte) ([]byte, error) { if strings.HasSuffix(mtype, "script") { return true, true } + + } + + if strings.HasPrefix(mtype, "audio/") { + switch strings.TrimPrefix(mtype, "audio/") { + case "wave", "wav", "x-wav", "x-pn-wav": + return true, true + } } return false, false |
