mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
No longer returning error messages when given bad input, because then MailChimp won't accept it as a webhook.
This commit is contained in:
parent
e821e61d09
commit
7bc6d0f6ed
1 changed files with 5 additions and 2 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue