Updated npm nonsense for ubuntu 20.04

This commit is contained in:
Pedro Pinto committed 2020-05-23 10:14:15 -04:00
1 parent 8dfc6caa7e
commit e443009f8c
28162 files changed
+978683 -2336900

No files matched your search

+8 -25
View File
@@ -1,31 +1,14 @@
var http = require('http')
var url = require('url')
var http = require('http');
var https = module.exports
var https = module.exports;
for (var key in http) {
if (http.hasOwnProperty(key)) https[key] = http[key]
}
if (http.hasOwnProperty(key)) https[key] = http[key];
};
https.request = function (params, cb) {
params = validateParams(params)
return http.request.call(this, params, cb)
}
https.get = function (params, cb) {
params = validateParams(params)
return http.get.call(this, params, cb)
}
function validateParams (params) {
if (typeof params === 'string') {
params = url.parse(params)
}
if (!params.protocol) {
params.protocol = 'https:'
}
if (params.protocol !== 'https:') {
throw new Error('Protocol "' + params.protocol + '" not supported. Expected "https:"')
}
return params
if (!params) params = {};
params.scheme = 'https';
params.protocol = 'https:';
return http.request.call(this, params, cb);
}