removing 'jpeg' as valid format and no checking agains lowercase
This commit is contained in:
parent
ad4ed7a06b
commit
56aa1b39f0
@ -1,8 +1,8 @@
|
||||
const VALID_IMAGE_FORMATS = ['png', 'jpg', 'jpeg'];
|
||||
const VALID_IMAGE_FORMATS = ['png', 'jpg'];
|
||||
|
||||
module.exports = function checkStaticImageFormat () {
|
||||
return function checkStaticImageFormatMiddleware (req, res, next) {
|
||||
if(!VALID_IMAGE_FORMATS.includes(req.params.format.toLowerCase())) {
|
||||
if(!VALID_IMAGE_FORMATS.includes(req.params.format)) {
|
||||
return next(new Error(`Unsupported image format "${req.params.format}"`));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user