bdy 1.22.85-stage → 1.22.86-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/distTs/package.json
CHANGED
|
@@ -139,10 +139,10 @@ class AgentSocketClient extends events_1.default {
|
|
|
139
139
|
forceBase64: true,
|
|
140
140
|
transports: ['websocket'],
|
|
141
141
|
reconnection: false,
|
|
142
|
-
rejectUnauthorized: !(0, utils_1.
|
|
142
|
+
rejectUnauthorized: !(0, utils_1.canSkipSslVerify)(host),
|
|
143
143
|
// @ts-ignore
|
|
144
144
|
agent: new https_1.Agent({
|
|
145
|
-
rejectUnauthorized: !(0, utils_1.
|
|
145
|
+
rejectUnauthorized: !(0, utils_1.canSkipSslVerify)(host),
|
|
146
146
|
}),
|
|
147
147
|
maxHttpBufferSize: 3e6,
|
|
148
148
|
extraHeaders: {
|
package/distTs/src/api/client.js
CHANGED
|
@@ -26,7 +26,7 @@ class ApiClient {
|
|
|
26
26
|
this.clientToken = clientToken;
|
|
27
27
|
this.client = new undici_1.Pool(baseUrl, {
|
|
28
28
|
connect: {
|
|
29
|
-
rejectUnauthorized: !(0, utils_1.
|
|
29
|
+
rejectUnauthorized: !(0, utils_1.canSkipSslVerify)(baseUrl.hostname),
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -26,7 +26,7 @@ const makeRequest = async (host, path, body, method = 'POST', respAsJson = true,
|
|
|
26
26
|
headers: body ? { 'Content-Type': 'application/json' } : undefined,
|
|
27
27
|
method,
|
|
28
28
|
signal: c.signal,
|
|
29
|
-
dispatcher: (0, utils_1.
|
|
29
|
+
dispatcher: (0, utils_1.canSkipSslVerify)(host) ? output_1.default.getUndiciUnauthorizedAgent() : undefined,
|
|
30
30
|
});
|
|
31
31
|
if (respAsJson)
|
|
32
32
|
data = await response.json();
|
|
@@ -165,7 +165,7 @@ class TunnelHttpAuth {
|
|
|
165
165
|
const { Pool: UndiciPool } = require('undici');
|
|
166
166
|
this.clients[host] = new UndiciPool(host, {
|
|
167
167
|
connect: {
|
|
168
|
-
rejectUnauthorized: !(0, utils_1.
|
|
168
|
+
rejectUnauthorized: !(0, utils_1.canSkipSslVerify)(host),
|
|
169
169
|
},
|
|
170
170
|
});
|
|
171
171
|
}
|
package/distTs/src/utils.js
CHANGED
|
@@ -48,7 +48,7 @@ exports.openApiPrepareUrl = openApiPrepareUrl;
|
|
|
48
48
|
exports.getOpenApiEndpointByApiBaseUrl = getOpenApiEndpointByApiBaseUrl;
|
|
49
49
|
exports.isValidDomain = isValidDomain;
|
|
50
50
|
exports.isInSandbox = isInSandbox;
|
|
51
|
-
exports.
|
|
51
|
+
exports.canSkipSslVerify = canSkipSslVerify;
|
|
52
52
|
exports.isValidSubdomain = isValidSubdomain;
|
|
53
53
|
exports.isValidEmail = isValidEmail;
|
|
54
54
|
exports.isValidName = isValidName;
|
|
@@ -716,9 +716,10 @@ function isInSandbox() {
|
|
|
716
716
|
}
|
|
717
717
|
// Verify TLS certs for real hosts; only local/IP dev hosts (self-signed)
|
|
718
718
|
// may skip verification. Accepts a full URL or a bare hostname.
|
|
719
|
-
function
|
|
719
|
+
function canSkipSslVerify(host) {
|
|
720
720
|
return (/^(https?:\/\/)?\d+\.\d+\.\d+\.\d+/.test(host) ||
|
|
721
721
|
/\.local\.io/.test(host) ||
|
|
722
|
+
/\.e2e\.com/.test(host) ||
|
|
722
723
|
/\.tsd\.com/.test(host));
|
|
723
724
|
}
|
|
724
725
|
function isValidSubdomain(prompt) {
|