emailengine-app 2.74.1 → 2.75.0
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/CHANGELOG.md +41 -0
- package/data/google-crawlers.json +1 -1
- package/lib/account.js +117 -63
- package/lib/api-routes/changes-routes.js +51 -0
- package/lib/api-routes/index.js +160 -0
- package/lib/api-routes/message-routes.js +3 -1
- package/lib/consts.js +21 -0
- package/lib/db.js +4 -1
- package/lib/egress-filter.js +220 -0
- package/lib/email-client/base-client.js +5 -8
- package/lib/email-client/gmail/send-request.js +69 -0
- package/lib/email-client/gmail-client.js +6 -46
- package/lib/email-client/imap/detach-client.js +27 -0
- package/lib/email-client/imap/listing-diff.js +165 -0
- package/lib/email-client/imap/mailbox.js +35 -22
- package/lib/email-client/imap/subconnection.js +2 -4
- package/lib/email-client/imap/sync-operations.js +5 -3
- package/lib/email-client/imap-client.js +50 -84
- package/lib/email-client/notification-handler.js +11 -12
- package/lib/email-client/outlook/send-request.js +48 -0
- package/lib/email-client/outlook-client.js +7 -19
- package/lib/export.js +97 -21
- package/lib/imapproxy/imap-core/README.md +69 -0
- package/lib/imapproxy/imap-core/lib/imap-connection.js +1 -1
- package/lib/logger.js +14 -6
- package/lib/oauth/external-account-config.js +41 -1
- package/lib/oauth/external-account-signer.js +7 -2
- package/lib/oauth/verify-app.js +18 -3
- package/lib/queue-retention.js +56 -0
- package/lib/rate-limit.js +33 -11
- package/lib/respawn-backoff.js +95 -0
- package/lib/response-stream.js +138 -0
- package/lib/schemas.js +9 -2
- package/lib/sentry.js +8 -0
- package/lib/settings.js +4 -1
- package/lib/smtp-message-processor.js +131 -0
- package/lib/tools.js +48 -5
- package/lib/ui-routes/admin-config-routes.js +22 -18
- package/lib/ui-routes/internals-routes.js +32 -0
- package/lib/utils/network.js +122 -3
- package/lib/web-safe-html.js +401 -0
- package/lib/webhook-request.js +40 -2
- package/lib/webhooks.js +2 -3
- package/package.json +15 -13
- package/sbom.json +1 -1
- package/server.js +33 -8
- package/static/js/ee-client.js +55 -6
- package/static/js/ui.js +13 -0
- package/static/licenses.html +336 -286
- package/translations/messages.pot +12 -12
- package/views/config/webhooks.hbs +2 -2
- package/views/internals/index.hbs +8 -0
- package/views/partials/webhooks_editor_functions.hbs +1 -1
- package/workers/api.js +52 -233
- package/workers/documents.js +6 -0
- package/workers/export.js +37 -16
- package/workers/imap.js +64 -29
- package/workers/smtp.js +50 -91
- package/workers/submit.js +10 -0
- package/workers/webhooks.js +23 -2
package/workers/imap.js
CHANGED
|
@@ -49,6 +49,9 @@ const DEFAULT_STATES = {
|
|
|
49
49
|
disconnected: 0
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
// Minimum interval between reports about failed account log writes, see getAccountLogger()
|
|
53
|
+
const LOG_FAILURE_REPORT_INTERVAL = 60 * 1000;
|
|
54
|
+
|
|
52
55
|
const NO_ACTIVE_HANDLER_RESP_ERR = new Error('No active handler for requested account. Try again later.');
|
|
53
56
|
NO_ACTIVE_HANDLER_RESP_ERR.statusCode = 503;
|
|
54
57
|
NO_ACTIVE_HANDLER_RESP_ERR.code = 'WorkerNotAvailable';
|
|
@@ -116,11 +119,42 @@ class ConnectionHandler {
|
|
|
116
119
|
let logKey = this.getLogKey(account);
|
|
117
120
|
let logging = await settings.getLoggingInfo(account);
|
|
118
121
|
|
|
119
|
-
|
|
122
|
+
// log() runs once per protocol line, so a persistent write failure (Redis OOM, MISCONF,
|
|
123
|
+
// READONLY) would report itself on every single line. Report the first failure, then at
|
|
124
|
+
// most one summary per interval, otherwise a failing account log floods the main log.
|
|
125
|
+
let lastFailureReport = 0;
|
|
126
|
+
let suppressedFailures = 0;
|
|
127
|
+
let reportFailure = (msg, err) => {
|
|
128
|
+
let now = Date.now();
|
|
129
|
+
if (now - lastFailureReport < LOG_FAILURE_REPORT_INTERVAL) {
|
|
130
|
+
suppressedFailures++;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ioredis attaches the failed command to the error, and the arguments of these
|
|
135
|
+
// writes include the encoded log entry itself (protocol traces, and even raw
|
|
136
|
+
// credentials when EENGINE_LOG_RAW is set), so such errors are summarized instead
|
|
137
|
+
// of being handed to the log serializer, which copies all enumerable properties
|
|
138
|
+
let reported = err && (err.command || err.previousErrors) ? { name: err.name, code: err.code, message: err.message } : err;
|
|
139
|
+
|
|
140
|
+
let payload = { msg, account, err: reported };
|
|
141
|
+
if (suppressedFailures) {
|
|
142
|
+
payload.suppressed = suppressedFailures;
|
|
143
|
+
}
|
|
144
|
+
logger.error(payload);
|
|
145
|
+
|
|
146
|
+
lastFailureReport = now;
|
|
147
|
+
suppressedFailures = 0;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// Members are referenced by name instead of through `this` as this object is passed
|
|
151
|
+
// around to client classes that might call log() detached from its receiver
|
|
152
|
+
let accountLogger = {
|
|
120
153
|
enabled: logging.enabled,
|
|
121
154
|
maxLogLines: logging.maxLogLines,
|
|
155
|
+
|
|
122
156
|
log(entry) {
|
|
123
|
-
if (!
|
|
157
|
+
if (!accountLogger.maxLogLines || !accountLogger.enabled) {
|
|
124
158
|
return;
|
|
125
159
|
}
|
|
126
160
|
|
|
@@ -134,19 +168,22 @@ class ConnectionHandler {
|
|
|
134
168
|
redis
|
|
135
169
|
.multi()
|
|
136
170
|
.rpush(logKey, logRow)
|
|
137
|
-
.ltrim(logKey, -
|
|
171
|
+
.ltrim(logKey, -accountLogger.maxLogLines, -1)
|
|
138
172
|
.exec()
|
|
139
|
-
.catch(err =>
|
|
173
|
+
.catch(err => reportFailure('Failed to update log entries', err));
|
|
140
174
|
} catch (err) {
|
|
141
|
-
|
|
175
|
+
reportFailure('Failed to encode log entry', err);
|
|
142
176
|
}
|
|
143
177
|
},
|
|
178
|
+
|
|
144
179
|
async reload() {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
180
|
+
let updated = await settings.getLoggingInfo(account);
|
|
181
|
+
accountLogger.enabled = updated.enabled;
|
|
182
|
+
accountLogger.maxLogLines = updated.maxLogLines;
|
|
148
183
|
}
|
|
149
184
|
};
|
|
185
|
+
|
|
186
|
+
return accountLogger;
|
|
150
187
|
}
|
|
151
188
|
|
|
152
189
|
async assignConnection(account, runIndex, initOpts) {
|
|
@@ -264,7 +301,7 @@ class ConnectionHandler {
|
|
|
264
301
|
|
|
265
302
|
if (accountData.state) {
|
|
266
303
|
await redis.hSetExists(accountObject.connection.getAccountKey(), 'state', accountData.state);
|
|
267
|
-
await emitChangeEvent(
|
|
304
|
+
await emitChangeEvent(logger, account, 'state', accountData.state);
|
|
268
305
|
}
|
|
269
306
|
|
|
270
307
|
// do not wait before returning as it may take forever
|
|
@@ -299,7 +336,7 @@ class ConnectionHandler {
|
|
|
299
336
|
let state = 'connecting';
|
|
300
337
|
await redis.hSetExists(accountObject.connection.getAccountKey(), 'state', state);
|
|
301
338
|
accountObject.connection.state = state;
|
|
302
|
-
await emitChangeEvent(
|
|
339
|
+
await emitChangeEvent(logger, account, 'state', state);
|
|
303
340
|
await accountObject.connection.reconnect(true);
|
|
304
341
|
}
|
|
305
342
|
}
|
|
@@ -789,20 +826,21 @@ class ConnectionHandler {
|
|
|
789
826
|
};
|
|
790
827
|
}
|
|
791
828
|
|
|
792
|
-
|
|
793
|
-
|
|
829
|
+
// Shutdown teardown: closes every account connection this worker owns. The main thread owns
|
|
830
|
+
// the worker's lifetime and terminates it once the drain returns, so this deliberately does
|
|
831
|
+
// not exit the process itself.
|
|
832
|
+
async closeConnections() {
|
|
833
|
+
if (this.connectionsClosed) {
|
|
794
834
|
return;
|
|
795
835
|
}
|
|
796
|
-
logger.
|
|
797
|
-
this.
|
|
836
|
+
logger.info({ msg: 'Closing account connections', accounts: this.accounts.size });
|
|
837
|
+
this.connectionsClosed = true;
|
|
798
838
|
|
|
799
839
|
this.accounts.forEach(accountObject => {
|
|
800
840
|
if (accountObject && accountObject.connection) {
|
|
801
841
|
accountObject.connection.close();
|
|
802
842
|
}
|
|
803
843
|
});
|
|
804
|
-
|
|
805
|
-
logger.flush(() => process.exit());
|
|
806
844
|
}
|
|
807
845
|
|
|
808
846
|
// some general message
|
|
@@ -845,6 +883,13 @@ class ConnectionHandler {
|
|
|
845
883
|
case 'resource-usage':
|
|
846
884
|
return threadStats.usage();
|
|
847
885
|
|
|
886
|
+
// Shutdown drain. Signals reach the main thread only, so this worker cannot notice
|
|
887
|
+
// SIGTERM itself; server.js forwards it here on the way down so accounts get a chance
|
|
888
|
+
// to close their connections cleanly instead of having the sockets cut.
|
|
889
|
+
case 'close':
|
|
890
|
+
await this.closeConnections();
|
|
891
|
+
return true;
|
|
892
|
+
|
|
848
893
|
case 'delete':
|
|
849
894
|
case 'update':
|
|
850
895
|
case 'sync':
|
|
@@ -994,19 +1039,9 @@ parentPort.on('message', message => {
|
|
|
994
1039
|
connectionHandler.onMessage(message).catch(err => logger.error({ msg: 'Failed to process IPC message', err }));
|
|
995
1040
|
});
|
|
996
1041
|
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
logger.flush(() => process.exit(4));
|
|
1001
|
-
});
|
|
1002
|
-
});
|
|
1003
|
-
|
|
1004
|
-
process.on('SIGINT', () => {
|
|
1005
|
-
connectionHandler.kill().catch(err => {
|
|
1006
|
-
logger.error({ msg: 'Execution failed', err });
|
|
1007
|
-
logger.flush(() => process.exit(5));
|
|
1008
|
-
});
|
|
1009
|
-
});
|
|
1042
|
+
// NB! No SIGTERM/SIGINT handlers here. Node delivers signals to the main thread only, so handlers
|
|
1043
|
+
// registered in a worker thread never run. Shutdown reaches this worker as a 'close' command from
|
|
1044
|
+
// server.js instead; see onCommand().
|
|
1010
1045
|
|
|
1011
1046
|
main().catch(err => {
|
|
1012
1047
|
logger.fatal({ msg: 'Execution failed', err });
|
package/workers/smtp.js
CHANGED
|
@@ -17,8 +17,7 @@ const util = require('util');
|
|
|
17
17
|
const { redis } = require('../lib/db');
|
|
18
18
|
const { Account } = require('../lib/account');
|
|
19
19
|
const getSecret = require('../lib/get-secret');
|
|
20
|
-
const {
|
|
21
|
-
const { HeadersRewriter } = require('../lib/headers-rewriter');
|
|
20
|
+
const { collectMessage } = require('../lib/smtp-message-processor');
|
|
22
21
|
const settings = require('../lib/settings');
|
|
23
22
|
|
|
24
23
|
const { encrypt, decrypt } = require('../lib/encrypt');
|
|
@@ -113,31 +112,6 @@ for (let level of ['trace', 'debug', 'info', 'warn', 'error', 'fatal']) {
|
|
|
113
112
|
// so onAuth caches the Account for later processing steps.
|
|
114
113
|
const onAuth = createSmtpAuthHandler({ accountCache: ACCOUNT_CACHE, call });
|
|
115
114
|
|
|
116
|
-
function processMessage(stream, session, meta) {
|
|
117
|
-
meta = meta || {};
|
|
118
|
-
const splitter = new Splitter();
|
|
119
|
-
const joiner = new Joiner();
|
|
120
|
-
|
|
121
|
-
const headersRewriter = new HeadersRewriter(async headers => {
|
|
122
|
-
let requestedAccount = headers.getFirst('x-ee-account');
|
|
123
|
-
headers.remove('x-ee-account');
|
|
124
|
-
if (requestedAccount) {
|
|
125
|
-
meta.requestedAccount = requestedAccount;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
let idempotencyKey = headers.getFirst('x-ee-idempotency-key');
|
|
129
|
-
headers.remove('x-ee-idempotency-key');
|
|
130
|
-
if (idempotencyKey) {
|
|
131
|
-
meta.idempotencyKey = idempotencyKey;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
stream.once('error', err => joiner.emit('error', err));
|
|
136
|
-
headersRewriter.once('error', err => joiner.emit('error', err));
|
|
137
|
-
|
|
138
|
-
return stream.pipe(splitter).pipe(headersRewriter).pipe(joiner);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
115
|
async function checkAccountData(session, messageMeta) {
|
|
142
116
|
let accountObject;
|
|
143
117
|
|
|
@@ -243,74 +217,59 @@ async function init() {
|
|
|
243
217
|
};
|
|
244
218
|
|
|
245
219
|
serverOptions.onData = (rawStream, session, callback) => {
|
|
246
|
-
let chunks = [];
|
|
247
|
-
let chunklen = 0;
|
|
248
|
-
|
|
249
220
|
let messageMeta = {};
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
221
|
+
|
|
222
|
+
// Collecting the message lives in lib/smtp-message-processor.js so that the control
|
|
223
|
+
// header stripping, the stream error handling and the size verdict are unit testable -
|
|
224
|
+
// this worker can not be required from a test, it boots an SMTP server on load.
|
|
225
|
+
// collectMessage() rejects on a processing error instead of leaving it unhandled, which
|
|
226
|
+
// used to kill the entire worker thread rather than the one failing submission.
|
|
227
|
+
collectMessage(rawStream, messageMeta)
|
|
228
|
+
.then(async ({ message, sizeExceeded }) => {
|
|
229
|
+
if (sizeExceeded) {
|
|
230
|
+
let err = new Error('Message exceeds fixed maximum message size');
|
|
231
|
+
err.responseCode = 552;
|
|
232
|
+
throw err;
|
|
258
233
|
}
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
234
|
|
|
262
|
-
|
|
263
|
-
let err;
|
|
264
|
-
if (stream.sizeExceeded) {
|
|
265
|
-
err = new Error('Message exceeds fixed maximum message size');
|
|
266
|
-
err.responseCode = 552;
|
|
267
|
-
return callback(err);
|
|
268
|
-
}
|
|
235
|
+
let accountObject = await checkAccountData(session, messageMeta);
|
|
269
236
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
event: 'smtpSubmitFail'
|
|
307
|
-
});
|
|
308
|
-
logger.error({ msg: 'Failed to submit message', account: session.user, err });
|
|
309
|
-
callback(err);
|
|
310
|
-
});
|
|
311
|
-
})
|
|
312
|
-
.catch(err => callback(err));
|
|
313
|
-
});
|
|
237
|
+
let payload = {
|
|
238
|
+
envelope: {
|
|
239
|
+
from: session.envelope.mailFrom.address,
|
|
240
|
+
to: session.envelope.rcptTo.map(entry => entry.address)
|
|
241
|
+
},
|
|
242
|
+
raw: message
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
let res = await accountObject.queueMessage(payload, {
|
|
246
|
+
source: 'smtp',
|
|
247
|
+
idempotencyKey: messageMeta.idempotencyKey
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
// queued for later
|
|
251
|
+
metrics(logger, 'events', 'inc', {
|
|
252
|
+
event: 'smtpSubmitQueued'
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
logger.info({
|
|
256
|
+
msg: 'Message queued',
|
|
257
|
+
account: session.user,
|
|
258
|
+
messageId: res.messageId,
|
|
259
|
+
sendAt: res.sendAt,
|
|
260
|
+
queueId: res.queueId,
|
|
261
|
+
idempotency: res.idempotency
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
callback(null, `Message queued for delivery as ${res.queueId} (${new Date(res.sendAt).toISOString()})`);
|
|
265
|
+
})
|
|
266
|
+
.catch(err => {
|
|
267
|
+
metrics(logger, 'events', 'inc', {
|
|
268
|
+
event: 'smtpSubmitFail'
|
|
269
|
+
});
|
|
270
|
+
logger.error({ msg: 'Failed to submit message', account: session.user, err });
|
|
271
|
+
callback(err);
|
|
272
|
+
});
|
|
314
273
|
};
|
|
315
274
|
|
|
316
275
|
let tls = await settings.get('smtpServerTLSEnabled');
|
package/workers/submit.js
CHANGED
|
@@ -421,6 +421,16 @@ async function onCommand(command) {
|
|
|
421
421
|
switch (command.cmd) {
|
|
422
422
|
case 'resource-usage':
|
|
423
423
|
return threadStats.usage();
|
|
424
|
+
|
|
425
|
+
// Shutdown drain. Signals reach the main thread only, so server.js forwards them here.
|
|
426
|
+
// This matters more than for the other queues: the `iaq:` entry is cleared in the
|
|
427
|
+
// 'completed' handler, so a thread terminated mid-delivery leaves the job to be recovered
|
|
428
|
+
// as stalled and re-run - re-sending a message the MTA had already accepted. A graceful
|
|
429
|
+
// close stops fetching new jobs immediately and waits for the in-flight one.
|
|
430
|
+
case 'close':
|
|
431
|
+
await submitWorker.close();
|
|
432
|
+
return true;
|
|
433
|
+
|
|
424
434
|
default:
|
|
425
435
|
logger.debug({ msg: 'Unhandled command', command });
|
|
426
436
|
return 999;
|
package/workers/webhooks.js
CHANGED
|
@@ -12,12 +12,13 @@ const { GooglePubSub } = require('../lib/oauth/pubsub/google');
|
|
|
12
12
|
|
|
13
13
|
const { readEnvValue, threadStats, getDuration, httpAgent, getServiceSecret, maybeReloadHttpProxyAgent } = require('../lib/tools');
|
|
14
14
|
const { sendWebhookRequest } = require('../lib/webhook-request');
|
|
15
|
+
const { assertAllowedUrl, normalizePolicy, POLICY_OFF } = require('../lib/egress-filter');
|
|
15
16
|
|
|
16
17
|
const { initSentry } = require('../lib/sentry');
|
|
17
18
|
initSentry('webhooks');
|
|
18
19
|
|
|
19
20
|
const { redis, queueConf } = require('../lib/db');
|
|
20
|
-
const { Worker } = require('bullmq');
|
|
21
|
+
const { Worker, UnrecoverableError } = require('bullmq');
|
|
21
22
|
const settings = require('../lib/settings');
|
|
22
23
|
|
|
23
24
|
const { REDIS_PREFIX, ACCOUNT_DELETED_NOTIFY, MESSAGE_NEW_NOTIFY } = require('../lib/consts');
|
|
@@ -39,6 +40,17 @@ const NOTIFY_QC = (readEnvValue('EENGINE_NOTIFY_QC') && Number(readEnvValue('EEN
|
|
|
39
40
|
// DEFAULT_WEBHOOK_REQUEST_TIMEOUT baked into sendWebhookRequest when unset
|
|
40
41
|
const WEBHOOK_TIMEOUT = getDuration(readEnvValue('EENGINE_WEBHOOK_TIMEOUT')) || false;
|
|
41
42
|
|
|
43
|
+
// Which destinations webhook deliveries may reach. An account-scoped API token can set both the
|
|
44
|
+
// webhook URL and its custom headers, so without this the least-privileged credential in the
|
|
45
|
+
// system can aim EmailEngine at anything its host can route to. Defaults to blocking the
|
|
46
|
+
// link-local range (cloud instance metadata); `private` also blocks RFC1918 and friends, `off`
|
|
47
|
+
// disables the check and restores redirect following. See lib/egress-filter.js
|
|
48
|
+
const WEBHOOK_EGRESS_POLICY = normalizePolicy(readEnvValue('EENGINE_WEBHOOK_EGRESS_POLICY'));
|
|
49
|
+
|
|
50
|
+
// Built once rather than per delivery. Null when the policy is off, which also restores fetch's
|
|
51
|
+
// own redirect following in sendWebhookRequest().
|
|
52
|
+
const validateWebhookTarget = WEBHOOK_EGRESS_POLICY === POLICY_OFF ? null : target => assertAllowedUrl(target, { policy: WEBHOOK_EGRESS_POLICY });
|
|
53
|
+
|
|
42
54
|
let callQueue = new Map();
|
|
43
55
|
let mids = 0;
|
|
44
56
|
|
|
@@ -413,7 +425,8 @@ const notifyWorker = new Worker(
|
|
|
413
425
|
body,
|
|
414
426
|
headers,
|
|
415
427
|
dispatcher: httpAgent.retry,
|
|
416
|
-
timeout: WEBHOOK_TIMEOUT
|
|
428
|
+
timeout: WEBHOOK_TIMEOUT,
|
|
429
|
+
validateTarget: validateWebhookTarget
|
|
417
430
|
});
|
|
418
431
|
duration = Date.now() - start;
|
|
419
432
|
} catch (err) {
|
|
@@ -514,6 +527,14 @@ const notifyWorker = new Worker(
|
|
|
514
527
|
status: 'fail'
|
|
515
528
|
});
|
|
516
529
|
|
|
530
|
+
// Neither of these changes on a retry: the egress policy rejects the same destination
|
|
531
|
+
// every time, and an endpoint configured to redirect keeps redirecting. Spending the
|
|
532
|
+
// remaining attempts on them only delays the operator seeing the real reason in the
|
|
533
|
+
// error flag. Fail the job now and keep the message.
|
|
534
|
+
if (err.code === 'EEGRESSBLOCKED' || err.code === 'EREDIRECTNOTFOLLOWED') {
|
|
535
|
+
throw new UnrecoverableError(err.message);
|
|
536
|
+
}
|
|
537
|
+
|
|
517
538
|
throw err;
|
|
518
539
|
} finally {
|
|
519
540
|
if (duration) {
|