update JetStream URL (#3165)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
|
var parse = require("url").parse;
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -19,7 +20,9 @@ module.exports = function(url, callback) {
|
|||||||
var result = read(url);
|
var result = read(url);
|
||||||
result.on("error", function(e) {
|
result.on("error", function(e) {
|
||||||
if (e.code != "ENOENT") return callback(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);
|
if (res.statusCode !== 200) return callback(res);
|
||||||
res.pipe(fs.createWriteStream(local(url)).on("close", function() {
|
res.pipe(fs.createWriteStream(local(url)).on("close", function() {
|
||||||
callback(null, read(url));
|
callback(null, read(url));
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var site = "http://browserbench.org/JetStream";
|
var site = "https://browserbench.org/JetStream";
|
||||||
if (typeof phantom == "undefined") {
|
if (typeof phantom == "undefined") {
|
||||||
require("../tools/exit");
|
require("../tools/exit");
|
||||||
var args = process.argv.slice(2);
|
var args = process.argv.slice(2);
|
||||||
|
|||||||
Reference in New Issue
Block a user