Skip to content

Commit db0b7fe

Browse files
authored
fix: [FS-12201] .m4a files mime type from audio/x-m4a to audio/mp4 (#600)
1 parent 38c234b commit db0b7fe

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/lib/utils/extensions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,4 +953,5 @@ export const ExtensionsMap = {
953953
'application/x-typescript': 'ts',
954954
'application/x-java-archive': 'jar',
955955
'application/x-sharedlib': 'so',
956+
'image/avif': 'avif',
956957
};

src/lib/utils/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ export const uniqueId = (len: number = 10): string => {
101101
* @param {Uint8Array | Buffer} file
102102
* @returns {string} - mimetype
103103
*/
104-
export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Promise<string> => {
104+
export const getMimetype = async (file: Uint8Array | Buffer, name?: string): Promise<string> => {
105105
let type;
106106

107107
try {
108108
type = await fromBuffer(file);
109-
} catch(e) {
110-
console.warn("An exception occurred while processing the buffer:", e.message);
109+
} catch (e) {
110+
console.warn('An exception occurred while processing the buffer:', e.message);
111111
}
112112

113-
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip'];
113+
const excludedMimetypes = ['text/plain', 'application/octet-stream', 'application/x-ms', 'application/x-msi', 'application/zip', 'audio/x-m4a'];
114114

115115
if (type && excludedMimetypes.indexOf(type.mime) === -1) {
116116
return type.mime;
@@ -182,9 +182,9 @@ export const extensionToMime = (ext: string) => {
182182
export type SanitizeOptions =
183183
| boolean
184184
| {
185-
exclude?: string[];
186-
replacement?: string;
187-
};
185+
exclude?: string[];
186+
replacement?: string;
187+
};
188188

189189
/**
190190
* Sanitize file name

0 commit comments

Comments
 (0)