Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upload: Support additional .wav mime-types.

Alex Vandiver9cdb40027e77
diff --git a/api_docs/message-formatting.md b/api_docs/message-formatting.md
index c2965212263..22d7694ac5e 100644
--- a/api_docs/message-formatting.md
+++ b/api_docs/message-formatting.md
@@ -435,7 +435,8 @@ generate a video preview element with the following format.
When the Markdown media syntax is used with an uploaded file with an
audio `Content-Type`, Zulip will generate an HTML5 `<audio>` player
element. Supported MIME types are currently `audio/aac`, `audio/flac`,
-`audio/mpeg`, and `audio/wav`.
+`audio/mpeg`, and `audio/wav` (and its `audio/x-wav` and
+`audio/vnd.wave` variants).
For example, `![file.mp3](/user_uploads/path/to/file.mp3)` renders as:
diff --git a/web/src/upload.ts b/web/src/upload.ts
index ff2bb682baf..590b894752e 100644
--- a/web/src/upload.ts
+++ b/web/src/upload.ts
@@ -54,8 +54,10 @@ const SUPPORTED_AUDIO_TYPES = new Set([
"audio/flac",
"audio/mp4",
"audio/mpeg",
+ "audio/vnd.wave",
"audio/wav",
"audio/webm",
+ "audio/x-wav",
]);
function is_supported_audio_type(file_type: string): boolean {
diff --git a/zerver/lib/mime_types.py b/zerver/lib/mime_types.py
index 10be3103825..1583b601263 100644
--- a/zerver/lib/mime_types.py
+++ b/zerver/lib/mime_types.py
@@ -28,8 +28,10 @@ AUDIO_INLINE_MIME_TYPES = [
"audio/flac",
"audio/mp4",
"audio/mpeg",
+ "audio/vnd.wave",
"audio/wav",
"audio/webm",
+ "audio/x-wav",
]
INLINE_MIME_TYPES = [