From 6eac9b907d48fd56a88825ac9c83b747d49443b9 Mon Sep 17 00:00:00 2001 From: jomo Date: Wed, 5 Nov 2014 00:12:08 +0100 Subject: [PATCH] clarify config options --- modules/config.js | 4 ++-- routes/avatars.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/config.js b/modules/config.js index eb03af3..9b15725 100644 --- a/modules/config.js +++ b/modules/config.js @@ -1,8 +1,8 @@ var config = { - min_size: 0, // < 0 will (obviously) cause crash + min_size: 1, // < 1 will (obviously) cause crash max_size: 512, // too big values might lead to slow response time or DoS default_size: 160, // size to be used when no size given - local_cache_time: 3600, // seconds until we will check if the image changed + local_cache_time: 3600, // seconds until we will check if the image changed. should be > 60 to prevent mojang 429 response browser_cache_time: 3600, // seconds until browser will request image again http_timeout: 1000, // ms until connection to mojang is dropped faces_dir: 'skins/faces/', // directory where faces are kept. should have trailing '/' diff --git a/routes/avatars.js b/routes/avatars.js index b486e2e..f759d7d 100644 --- a/routes/avatars.js +++ b/routes/avatars.js @@ -12,7 +12,7 @@ router.get('/:uuid.:ext?', function(req, res) { var start = new Date(); // Prevent app from crashing/freezing - if (size <= config.min_size || size > config.max_size) { + if (size < config.min_size || size > config.max_size) { // "Unprocessable Entity", valid request, but semantically erroneous: // https://tools.ietf.org/html/rfc4918#page-78 res.status(422).send("422 Invalid size");