Bläddra i källkod

Fix error when no url is provided

Gaël Métais 8 år sedan
förälder
incheckning
def0144dab
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      lib/server/controllers/apiController.js

+ 1 - 1
lib/server/controllers/apiController.js

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