Fixed mail auth

Sorry for committing directly to production branch
This commit is contained in:
Michael Schmatz 2014-04-10 17:40:27 -07:00
parent a90b54211b
commit 80c2d07b72

View file

@ -37,7 +37,7 @@ getTimeFromDaysAgo = (now, daysAgo) ->
t = now - 86400 * 1000 * daysAgo - LADDER_PREGAME_INTERVAL
isRequestFromDesignatedCronHandler = (req, res) ->
requestIP = req.headers['x-forwarded-for'][0]
requestIP = req.headers['x-forwarded-for']?.replace(" ","").split(",")[0]
if requestIP isnt config.mail.cronHandlerPublicIP and requestIP isnt config.mail.cronHandlerPrivateIP
console.log "RECEIVED REQUEST FROM IP #{requestIP}(headers indicate #{req.headers['x-forwarded-for']}"
console.log "UNAUTHORIZED ATTEMPT TO SEND TRANSACTIONAL LADDER EMAIL THROUGH CRON MAIL HANDLER"