Add runId quickfix

This commit is contained in:
Gaël Métais
2021-03-21 23:15:32 +00:00
parent 4e8cb19f55
commit 97099e9f65
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -19,9 +19,9 @@ var ApiController = function(app) {
// Create a new run
app.post('/api/runs', function(req, res) {
// Add http to the test URL
// Add https to the test URL
if (req.body.url && req.body.url.toLowerCase().indexOf('http://') !== 0 && req.body.url.toLowerCase().indexOf('https://') !== 0) {
req.body.url = 'http://' + req.body.url;
req.body.url = 'https://' + req.body.url;
}
// Block requests to unwanted websites (=spam)
+3 -2
View File
@@ -26,7 +26,7 @@ var ApiController = function(app) {
// Add http to the test URL
if (req.body.url && req.body.url.toLowerCase().indexOf('http://') !== 0 && req.body.url.toLowerCase().indexOf('https://') !== 0) {
req.body.url = 'http://' + req.body.url;
req.body.url = 'https://' + req.body.url;
}
// Block requests to unwanted websites (=spam)
@@ -270,7 +270,8 @@ var ApiController = function(app) {
return;
}
// TODO: Reverse quick fix
// Quickfix (TODO remove)
results.runId = runId;
results.screenshotUrl = '/api/results/' + runId + '/screenshot.jpg';
res.setHeader('Content-Type', 'application/json');