mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
* first action! (#1)
This commit is contained in:
parent
8deacc95b1
commit
ace1e6a69a
3750 changed files with 1155519 additions and 0 deletions
51
node_modules/agent-base/patch-core.js
generated
vendored
Normal file
51
node_modules/agent-base/patch-core.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
'use strict';
|
||||
const url = require('url');
|
||||
const https = require('https');
|
||||
|
||||
/**
|
||||
* This currently needs to be applied to all Node.js versions
|
||||
* in order to determine if the `req` is an HTTP or HTTPS request.
|
||||
*
|
||||
* There is currently no PR attempting to move this property upstream.
|
||||
*/
|
||||
const patchMarker = "__agent_base_https_request_patched__";
|
||||
if (!https.request[patchMarker]) {
|
||||
https.request = (function(request) {
|
||||
return function(_options, cb) {
|
||||
let options;
|
||||
if (typeof _options === 'string') {
|
||||
options = url.parse(_options);
|
||||
} else {
|
||||
options = Object.assign({}, _options);
|
||||
}
|
||||
if (null == options.port) {
|
||||
options.port = 443;
|
||||
}
|
||||
options.secureEndpoint = true;
|
||||
return request.call(https, options, cb);
|
||||
};
|
||||
})(https.request);
|
||||
https.request[patchMarker] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is needed for Node.js >= 9.0.0 to make sure `https.get()` uses the
|
||||
* patched `https.request()`.
|
||||
*
|
||||
* Ref: https://github.com/nodejs/node/commit/5118f31
|
||||
*/
|
||||
https.get = function (_url, _options, cb) {
|
||||
let options;
|
||||
if (typeof _url === 'string' && _options && typeof _options !== 'function') {
|
||||
options = Object.assign({}, url.parse(_url), _options);
|
||||
} else if (!_options && !cb) {
|
||||
options = _url;
|
||||
} else if (!cb) {
|
||||
options = _url;
|
||||
cb = _options;
|
||||
}
|
||||
|
||||
const req = https.request(options, cb);
|
||||
req.end();
|
||||
return req;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue