From 3e0394d0d82b557e7be5940afb25984f48b4665d Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 29 Nov 2014 11:11:40 -0800 Subject: [PATCH] Fixed the latest version handler to handle invalid original id inputs. --- server/commons/Handler.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/commons/Handler.coffee b/server/commons/Handler.coffee index 62dced867..92227d6e1 100644 --- a/server/commons/Handler.coffee +++ b/server/commons/Handler.coffee @@ -298,6 +298,8 @@ module.exports = class Handler getLatestVersion: (req, res, original, version) -> # can get latest overall version, latest of a major version, or a specific version + return @sendBadInputError(res, 'Invalid MongoDB id: '+original) if not Handler.isID(original) + query = { 'original': mongoose.Types.ObjectId(original) } if version? version = version.split('.')