Skip to content

Commit

Permalink
Merge pull request #695 from hassy/fix/http-invalid-url
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy authored Apr 27, 2019
2 parents f3d4b17 + 4fa297b commit b5d9fa0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/lib/engine_http.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
requestParams.agent = context._httpAgent;
}

if (!requestParams.url.startsWith('http')) {
let err = new Error(`Invalid URL - ${requestParams.url}`);
ee.emit('error', err.message);
return callback(err, context);
}

function requestCallback(err, res, body) {
if (err) {
return;
Expand Down

0 comments on commit b5d9fa0

Please sign in to comment.