From c76749084b613c765cff7a4e063e1cadb76dcc38 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 31 May 2018 16:23:49 +0800 Subject: update JetStream URL (#3165) --- test/fetch.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/fetch.js') diff --git a/test/fetch.js b/test/fetch.js index 5ca95bbb..eccdd71f 100644 --- a/test/fetch.js +++ b/test/fetch.js @@ -1,4 +1,5 @@ var fs = require("fs"); +var parse = require("url").parse; var path = require("path"); try { @@ -19,7 +20,9 @@ module.exports = function(url, callback) { var result = read(url); result.on("error", function(e) { if (e.code != "ENOENT") return callback(e); - require(url.slice(0, url.indexOf(":"))).get(url, function(res) { + var options = parse(url); + options.rejectUnauthorized = false; + require(options.protocol.slice(0, -1)).get(options, function(res) { if (res.statusCode !== 200) return callback(res); res.pipe(fs.createWriteStream(local(url)).on("close", function() { callback(null, read(url)); -- cgit v1.2.3