Updated dist files.
This commit is contained in:
parent
560adeabb0
commit
db604aa6af
@ -53,19 +53,25 @@ export function getUrl(href, options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
// @TODO: Once we drop support for node 8, we can pass the href
|
||||
// firectly into request and skip adding the components
|
||||
// to this request object
|
||||
const url = new URL(href);
|
||||
const request = {
|
||||
protocol: url.protocol,
|
||||
hostname: url.hostname,
|
||||
port: url.port,
|
||||
path: (url.pathname + url.search),
|
||||
method: (options.method || "GET"),
|
||||
headers: (options.headers || {}),
|
||||
};
|
||||
let req = null;
|
||||
switch (url.protocol) {
|
||||
case "http:": {
|
||||
req = http.request(url, request);
|
||||
case "http:":
|
||||
req = http.request(request);
|
||||
break;
|
||||
}
|
||||
case "https:":
|
||||
req = https.request(url, request);
|
||||
req = https.request(request);
|
||||
break;
|
||||
default:
|
||||
logger.throwError(`unsupported protocol ${url.protocol}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
|
@ -90,17 +90,20 @@ function getUrl(href, options) {
|
||||
}
|
||||
url = new url_1.URL(href);
|
||||
request = {
|
||||
protocol: url.protocol,
|
||||
hostname: url.hostname,
|
||||
port: url.port,
|
||||
path: (url.pathname + url.search),
|
||||
method: (options.method || "GET"),
|
||||
headers: (options.headers || {}),
|
||||
};
|
||||
req = null;
|
||||
switch (url.protocol) {
|
||||
case "http:": {
|
||||
req = http_1.default.request(url, request);
|
||||
case "http:":
|
||||
req = http_1.default.request(request);
|
||||
break;
|
||||
}
|
||||
case "https:":
|
||||
req = https_1.default.request(url, request);
|
||||
req = https_1.default.request(request);
|
||||
break;
|
||||
default:
|
||||
logger.throwError("unsupported protocol " + url.protocol, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
|
||||
|
@ -35,7 +35,7 @@
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x650d63a4fb9545025d67d16a3cf2f0dc41d0ccbf0bd90b095c119700de80144f",
|
||||
"tarballHash": "0x61705e91a9250f3d5b7cbf031c2aff7c41be3557228d156de9b27bed652ac282",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.0-beta.137"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user