tangerine 1.5.5 → 1.5.7
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/index.js +18 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1146,8 +1146,8 @@ class Tangerine extends dns.promises.Resolver {
|
|
|
1146
1146
|
// <https://github.com/nodejs/undici/issues/3353>
|
|
1147
1147
|
// eslint-disable-next-line no-await-in-loop, max-depth
|
|
1148
1148
|
if (body && typeof body.dump === 'function') await body.dump();
|
|
1149
|
-
//
|
|
1150
|
-
if (!abortController.signal.aborted) abortController.abort();
|
|
1149
|
+
// NOTE: we don't need to do this (causes uncaught exception)
|
|
1150
|
+
// if (!abortController.signal.aborted) abortController.abort();
|
|
1151
1151
|
break;
|
|
1152
1152
|
}
|
|
1153
1153
|
|
|
@@ -1176,7 +1176,8 @@ class Tangerine extends dns.promises.Resolver {
|
|
|
1176
1176
|
// eslint-disable-next-line max-depth
|
|
1177
1177
|
if (err.code === dns.NOTFOUND) throw err;
|
|
1178
1178
|
|
|
1179
|
-
|
|
1179
|
+
// eslint-disable-next-line max-depth
|
|
1180
|
+
if (err.status >= 429) ipErrors.push(err);
|
|
1180
1181
|
|
|
1181
1182
|
// break out of the loop if status code was not retryable
|
|
1182
1183
|
// eslint-disable-next-line max-depth
|
|
@@ -1230,7 +1231,8 @@ class Tangerine extends dns.promises.Resolver {
|
|
|
1230
1231
|
// https://github.com/mafintosh/dns-packet/issues/72
|
|
1231
1232
|
return packet.decode(buffer);
|
|
1232
1233
|
} catch (_err) {
|
|
1233
|
-
|
|
1234
|
+
// NOTE: we don't need to do this (causes uncaught exception)
|
|
1235
|
+
// if (!abortController.signal.aborted) abortController.abort();
|
|
1234
1236
|
debug(_err, { name, rrtype, ecsSubnet });
|
|
1235
1237
|
if (this.options.returnHTTPErrors) throw _err;
|
|
1236
1238
|
const err = this.constructor.createError(
|
|
@@ -1254,7 +1256,13 @@ class Tangerine extends dns.promises.Resolver {
|
|
|
1254
1256
|
// (instead they are called with "ABORT_ERR"; see ABORT_ERROR_CODES)
|
|
1255
1257
|
cancel() {
|
|
1256
1258
|
for (const abortController of this.abortControllers) {
|
|
1257
|
-
if (!abortController.signal.aborted)
|
|
1259
|
+
if (!abortController.signal.aborted) {
|
|
1260
|
+
try {
|
|
1261
|
+
abortController.abort();
|
|
1262
|
+
} catch (err) {
|
|
1263
|
+
this.options.logger.debug(err);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1258
1266
|
}
|
|
1259
1267
|
}
|
|
1260
1268
|
|
|
@@ -1272,7 +1280,11 @@ class Tangerine extends dns.promises.Resolver {
|
|
|
1272
1280
|
parentAbortController.signal.addEventListener(
|
|
1273
1281
|
'abort',
|
|
1274
1282
|
() => {
|
|
1275
|
-
|
|
1283
|
+
try {
|
|
1284
|
+
abortController.abort();
|
|
1285
|
+
} catch (err) {
|
|
1286
|
+
this.options.logger.debug(err);
|
|
1287
|
+
}
|
|
1276
1288
|
},
|
|
1277
1289
|
{ once: true }
|
|
1278
1290
|
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tangerine",
|
|
3
3
|
"description": "Tangerine is the best Node.js drop-in replacement for dns.promises.Resolver using DNS over HTTPS (\"DoH\") via undici with built-in retries, timeouts, smart server rotation, AbortControllers, and caching support for multiple backends (with TTL and purge support).",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.7",
|
|
5
5
|
"author": "Forward Email (https://forwardemail.net)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/forwardemail/nodejs-dns-over-https-tangerine/issues"
|