diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-05-31 16:23:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-31 16:23:49 +0800 |
commit | c76749084b613c765cff7a4e063e1cadb76dcc38 (patch) | |
tree | 580643ec3df1ef0e99f463c9db8d8ea2b7ce1cbd /test/fetch.js | |
parent | 5843494ee2d7e3a3953f4c9cefe5c8893d8b2d59 (diff) | |
download | tracifyjs-c76749084b613c765cff7a4e063e1cadb76dcc38.tar.gz tracifyjs-c76749084b613c765cff7a4e063e1cadb76dcc38.zip |
update JetStream URL (#3165)
Diffstat (limited to 'test/fetch.js')
-rw-r--r-- | test/fetch.js | 5 |
1 files changed, 4 insertions, 1 deletions
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)); |