Skip to content

Commit

Permalink
Fix webp mimetype (#3961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Murderlon committed Aug 10, 2022
1 parent 727fbc6 commit 90b62c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/@uppy/utils/src/getFileType.test.js
Expand Up @@ -37,6 +37,10 @@ describe('getFileType', () => {
name: 'bar.dicom',
data: 'sdfsfhfh329fhwihs',
}
const fileWebp = {
name: 'bar.webp',
data: 'sdfsfhfh329fhwihs',
}
const toUpper = (file) => ({ ...file, name: file.name.toUpperCase() })
expect(getFileType(fileMP3)).toEqual('audio/mp3')
expect(getFileType(toUpper(fileMP3))).toEqual('audio/mp3')
Expand All @@ -46,6 +50,8 @@ describe('getFileType', () => {
expect(getFileType(toUpper(fileMKV))).toEqual('video/x-matroska')
expect(getFileType(fileDicom)).toEqual('application/dicom')
expect(getFileType(toUpper(fileDicom))).toEqual('application/dicom')
expect(getFileType(fileWebp)).toEqual('image/webp')
expect(getFileType(toUpper(fileWebp))).toEqual('image/webp')
})

it('should fail gracefully if unable to detect', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/utils/src/mimeTypes.js
Expand Up @@ -11,6 +11,7 @@ export default {
svg: 'image/svg+xml',
jpg: 'image/jpeg',
png: 'image/png',
webp: 'image/webp',
gif: 'image/gif',
heic: 'image/heic',
heif: 'image/heif',
Expand Down

0 comments on commit 90b62c7

Please sign in to comment.