Fix url in queue or dashboard pages without http://

This commit is contained in:
Gaël Métais
2015-02-06 10:51:27 +01:00
parent 928e8f14ea
commit 39e6ecc920
+5
View File
@@ -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),