From 7bc6d0f6edb6c542e5709df8d537fb95a320f894 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Fri, 24 Jan 2014 13:55:23 -0800 Subject: [PATCH] No longer returning error messages when given bad input, because then MailChimp won't accept it as a webhook. --- server/routes/mail.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/routes/mail.coffee b/server/routes/mail.coffee index ce354681d..b824226d4 100644 --- a/server/routes/mail.coffee +++ b/server/routes/mail.coffee @@ -16,14 +16,17 @@ module.exports.setupRoutes = (app) -> unless post.type in ['unsubscribe', 'profile'] badLog("Bad post type: #{post.type}") - return errors.badInput(res, 'Bad post type') + res.send 'Bad post type' + return res.end() unless post.data.email badLog("Ignoring because no email: #{JSON.stringify(req.body, null, '\t')}") - return errors.badInput(res, 'No email provided') + res.send 'No email provided' + return res.end() unless post.data.email is 'sderickson@gmail.com' badLog("Ignoring because this is a test: #{JSON.stringify(req.body, null, '\t')}") + res.send 'This is a test...' return res.end() query = {'mailChimp.leid':post.data.web_id}