diff --git a/Dockerfile b/Dockerfile index 05a7a53..7aec736 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,3 +11,4 @@ COPY . . EXPOSE 3000 ENTRYPOINT ["node", "./src/index.js"] + diff --git a/src/controllers/user.js b/src/controllers/user.js index ae5fe4c..9f19858 100644 --- a/src/controllers/user.js +++ b/src/controllers/user.js @@ -1,5 +1,3 @@ - - import bcrypt from 'bcrypt'; import jwt from 'jsonwebtoken'; import path from 'path'; @@ -85,7 +83,9 @@ class UserController { } const image = await Jimp.read(tempPath); - if (image.bitmap.width != 64 || image.bitmap.height != 64) { + const allowedWidths = [32, 64, 128]; + const allowedHeights = [32, 64]; + if (!allowedWidths.includes(image.bitmap.width) || !allowedHeights.includes(image.bitmap.height)) { return res.status(400).send('This does not look like a minecraft skin.'); } try {