fix config, use min_scale + max_scale

This commit is contained in:
jomo
2014-12-08 15:01:23 +01:00
committed by Jake
parent dd2ac9ee4e
commit 62e1994121
2 changed files with 18 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ var human_status = {
// valid types: head, body. helmet is query param
// The Type logic should be two separate GET
// The Type logic should be two separate GET
// functions once response methods are extracted
router.get('/:type/:uuid.:ext?', function(req, res) {
var raw_type = req.params.type;
@@ -35,7 +35,7 @@ router.get('/:type/:uuid.:ext?', function(req, res) {
var start = new Date();
var etag = null;
if (scale > config.maximum_scale) {
if (scale < config.min_scale || scale > config.max_scale) {
// Preventing from OOM crashes.
res.status(422).send("422 Invalid Size");
} else if (!helpers.uuid_valid(uuid)) {