From 39e6ecc920f9d67e159e7a01f67adb09febda0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Fri, 6 Feb 2015 10:51:27 +0100 Subject: [PATCH] Fix url in queue or dashboard pages without http:// --- lib/server/controllers/apiController.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/server/controllers/apiController.js b/lib/server/controllers/apiController.js index 940c870..d087f08 100644 --- a/lib/server/controllers/apiController.js +++ b/lib/server/controllers/apiController.js @@ -20,6 +20,11 @@ var ApiController = function(app) { // Create a new run app.post('/api/runs', function(req, res) { + // Add http to the test URL + if (req.body.url.toLowerCase().indexOf('http://') !== 0 && req.body.url.toLowerCase().indexOf('https://') !== 0) { + req.body.url = 'http://' + req.body.url; + } + // Grab the test parameters and generate a random run ID var run = { runId: (Date.now()*1000 + Math.round(Math.random()*1000)).toString(36),