@nxtedition/nxt-undici 6.3.14 → 6.3.16
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/lib/index.js +2 -2
- package/lib/interceptor/log.js +2 -0
- package/lib/interceptor/response-retry.js +4 -6
- package/lib/utils.js +0 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -113,8 +113,8 @@ function wrapDispatch(dispatcher) {
|
|
|
113
113
|
signal: opts.signal ?? undefined,
|
|
114
114
|
reset: opts.reset ?? false,
|
|
115
115
|
blocking: opts.blocking ?? true,
|
|
116
|
-
headersTimeout: opts.headersTimeout,
|
|
117
|
-
bodyTimeout: opts.bodyTimeout,
|
|
116
|
+
headersTimeout: opts.timeout?.headers ?? opts.headersTimeout,
|
|
117
|
+
bodyTimeout: opts.timeout?.body ?? opts.bodyTimeout,
|
|
118
118
|
idempotent: opts.idempotent,
|
|
119
119
|
retry: opts.retry ?? 4,
|
|
120
120
|
proxy: opts.proxy ?? false,
|
package/lib/interceptor/log.js
CHANGED
|
@@ -111,12 +111,10 @@ class Handler extends DecoratorHandler {
|
|
|
111
111
|
|
|
112
112
|
const { start, size, end = size } = range
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
'content-range mismatch',
|
|
119
|
-
)
|
|
114
|
+
if (start == null || end == null || contentLength !== end - start) {
|
|
115
|
+
this.#headersSent = true
|
|
116
|
+
return super.onHeaders(statusCode, headers, resume)
|
|
117
|
+
}
|
|
120
118
|
|
|
121
119
|
this.#pos = start
|
|
122
120
|
this.#end = end ?? contentLength
|
package/lib/utils.js
CHANGED
|
@@ -380,9 +380,6 @@ export function decorateError(err, opts, { statusCode, headers, trailers, body }
|
|
|
380
380
|
origin: opts.origin,
|
|
381
381
|
method: opts?.method,
|
|
382
382
|
headers: opts?.headers,
|
|
383
|
-
body:
|
|
384
|
-
// TODO (fix): JSON.stringify POJO
|
|
385
|
-
typeof opts?.body !== 'string' || opts.body.length > 1024 ? undefined : opts.body,
|
|
386
383
|
}
|
|
387
384
|
|
|
388
385
|
if (Array.isArray(body) && body.every((x) => Buffer.isBuffer(x))) {
|
|
@@ -402,8 +399,6 @@ export function decorateError(err, opts, { statusCode, headers, trailers, body }
|
|
|
402
399
|
err.res = {
|
|
403
400
|
headers,
|
|
404
401
|
trailers,
|
|
405
|
-
// TODO (fix): JSON.stringify POJO
|
|
406
|
-
body: typeof body !== 'string' || body.length < 1024 ? undefined : body,
|
|
407
402
|
statusCode,
|
|
408
403
|
}
|
|
409
404
|
|