Fix content-type and file extensions (enforce image/jpeg and .jpg)

This commit is contained in:
Shawn 2018-09-03 21:43:12 -05:00
parent 32f0ab1c43
commit 92cd020c58
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@ const determineContentTypeFromExtension = (thumbnail) => {
switch (fileExt) { switch (fileExt) {
case 'jpeg': case 'jpeg':
case 'jpg': case 'jpg':
return 'image/jpg'; return 'image/jpeg';
case 'png': case 'png':
return 'image/png'; return 'image/png';
case 'gif': case 'gif':

View file

@ -8,7 +8,7 @@ function determineFileExtensionFromContentType (contentType) {
switch (contentType) { switch (contentType) {
case 'image/jpeg': case 'image/jpeg':
case 'image/jpg': case 'image/jpg':
return 'jpeg'; return 'jpg';
case 'image/png': case 'image/png':
return 'png'; return 'png';
case 'image/gif': case 'image/gif':
@ -16,8 +16,8 @@ function determineFileExtensionFromContentType (contentType) {
case 'video/mp4': case 'video/mp4':
return 'mp4'; return 'mp4';
default: default:
logger.debug('setting unknown file type as file extension jpeg'); logger.debug('setting unknown file type as file extension jpg');
return 'jpeg'; return 'jpg';
} }
} }