bugfixes!
This commit is contained in:
parent
ab3f9366f8
commit
acab5ff541
10
app.js
10
app.js
@ -36,6 +36,12 @@ app.get('/', function(req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.post('/text', function(req, res) {
|
app.post('/text', function(req, res) {
|
||||||
|
if (!req.body.number || !req.body.message) {
|
||||||
|
mpq.track('incomplete request');
|
||||||
|
res.send({success:false,message:'Incomplete request.'});
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
mpq.track('text',
|
mpq.track('text',
|
||||||
{number: req.body.number, message: req.body.message, ip: req.connection.remoteAddress});
|
{number: req.body.number, message: req.body.message, ip: req.connection.remoteAddress});
|
||||||
|
|
||||||
@ -76,11 +82,13 @@ app.post('/text', function(req, res) {
|
|||||||
res.send({success:false,message:'Could not validate IP quota.'});
|
res.send({success:false,message:'Could not validate IP quota.'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (num > 75) {
|
if (num > 75) {
|
||||||
mpq.track('exceeded ip quota');
|
mpq.track('exceeded ip quota');
|
||||||
res.send({success:false,message:'Exceeded quota for this IP address.'});
|
res.send({success:false,message:'Exceeded quota for this IP address.'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
sendText(req.body.number, req.body.message, function(err) {
|
sendText(req.body.number, req.body.message, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -107,7 +115,7 @@ function dateStr() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stripPhone(phone) {
|
function stripPhone(phone) {
|
||||||
return phone.replace(/\D/g, '');
|
return (phone+'').replace(/\D/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function validatePhone(phone) {
|
function validatePhone(phone) {
|
||||||
|
Loading…
Reference in New Issue
Block a user