clarify config options

This commit is contained in:
jomo 2014-11-05 00:12:08 +01:00
parent 2a13d1e1c5
commit 6eac9b907d
2 changed files with 3 additions and 3 deletions

View File

@ -1,8 +1,8 @@
var config = { 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 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 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 browser_cache_time: 3600, // seconds until browser will request image again
http_timeout: 1000, // ms until connection to mojang is dropped http_timeout: 1000, // ms until connection to mojang is dropped
faces_dir: 'skins/faces/', // directory where faces are kept. should have trailing '/' faces_dir: 'skins/faces/', // directory where faces are kept. should have trailing '/'

View File

@ -12,7 +12,7 @@ router.get('/:uuid.:ext?', function(req, res) {
var start = new Date(); var start = new Date();
// Prevent app from crashing/freezing // 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: // "Unprocessable Entity", valid request, but semantically erroneous:
// https://tools.ietf.org/html/rfc4918#page-78 // https://tools.ietf.org/html/rfc4918#page-78
res.status(422).send("422 Invalid size"); res.status(422).send("422 Invalid size");