|
@@ -33,6 +33,15 @@ module.exports = function(req, callback) {
|
|
var def = req.url.query.default;
|
|
var def = req.url.query.default;
|
|
var helm = req.url.query.hasOwnProperty("helm");
|
|
var helm = req.url.query.hasOwnProperty("helm");
|
|
|
|
|
|
|
|
+ // check for extra paths
|
|
|
|
+ if (req.url.path_list.length > 2) {
|
|
|
|
+ callback({
|
|
|
|
+ status: -2,
|
|
|
|
+ body: "Invalid URL Path"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
// 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:
|