From 4a3645e3edbfbecb62270770bbe5f6ceb7878d48 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Thu, 7 Aug 2014 19:25:34 -0700 Subject: [PATCH] Prevent invalid URI escapes from logging errors --- lib/web/webserver.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/web/webserver.js b/lib/web/webserver.js index 64d2f1e0..61d1332d 100644 --- a/lib/web/webserver.js +++ b/lib/web/webserver.js @@ -309,7 +309,9 @@ module.exports = { app.use(static(path.join("..", "..", "www"))); app.use(function (err, req, res, next) { if (err) { - Logger.errlog.log(err); + if (err.message && err.message.match(/failed to decode param/i)) { + return res.status(400).send("Malformed path: " + req.path); + } Logger.errlog.log(err.stack); res.send(500); } else {