Fix error when no url is provided

This commit is contained in:
Gaël Métais 2017-01-18 12:16:26 +07:00
parent 92fce802c5
commit def0144dab

View file

@ -24,7 +24,7 @@ var ApiController = function(app) {
}
// Block requests to unwanted websites (=spam)
if (isBlocked(req.body.url)) {
if (req.body.url && isBlocked(req.body.url)) {
console.error('Test blocked for URL: %s', req.body.url);
res.status(403).send('Forbidden');
return;