Fix content-type and file extensions (enforce image/jpeg and .jpg)
This commit is contained in:
parent
32f0ab1c43
commit
92cd020c58
2 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@ const determineContentTypeFromExtension = (thumbnail) => {
|
|||
switch (fileExt) {
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
return 'image/jpg';
|
||||
return 'image/jpeg';
|
||||
case 'png':
|
||||
return 'image/png';
|
||||
case 'gif':
|
||||
|
|
|
@ -8,7 +8,7 @@ function determineFileExtensionFromContentType (contentType) {
|
|||
switch (contentType) {
|
||||
case 'image/jpeg':
|
||||
case 'image/jpg':
|
||||
return 'jpeg';
|
||||
return 'jpg';
|
||||
case 'image/png':
|
||||
return 'png';
|
||||
case 'image/gif':
|
||||
|
@ -16,8 +16,8 @@ function determineFileExtensionFromContentType (contentType) {
|
|||
case 'video/mp4':
|
||||
return 'mp4';
|
||||
default:
|
||||
logger.debug('setting unknown file type as file extension jpeg');
|
||||
return 'jpeg';
|
||||
logger.debug('setting unknown file type as file extension jpg');
|
||||
return 'jpg';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue