@nxtedition/nxt-undici 6.2.32 → 6.2.34

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 CHANGED
@@ -83,12 +83,12 @@ function wrapDispatch(dispatcher) {
83
83
  dispatcher,
84
84
  interceptors.log({ bindings: { intercept: 'upstream' } }),
85
85
  interceptors.requestBodyFactory(),
86
- interceptors.lookup(),
87
86
  interceptors.responseRetry(),
88
87
  interceptors.responseVerify(),
89
88
  interceptors.proxy(),
90
89
  interceptors.cache(),
91
90
  interceptors.redirect(),
91
+ interceptors.lookup(),
92
92
  interceptors.log({ bindings: { intercept: 'downstream' } }),
93
93
  interceptors.requestId(),
94
94
  interceptors.responseError(),
@@ -12,14 +12,15 @@ function genReqId() {
12
12
  }
13
13
 
14
14
  export default () => (dispatch) => (opts, handler) => {
15
- const id = opts.id ? `${opts.id},${genReqId()}` : genReqId()
15
+ const prevId = opts.id ?? opts.headers?.['request-id']
16
+ const nextId = prevId ? `${prevId},${genReqId()}` : genReqId()
16
17
  return dispatch(
17
18
  {
18
19
  ...opts,
19
- id,
20
+ id: nextId,
20
21
  headers: {
21
22
  ...opts.headers,
22
- 'request-id': id,
23
+ 'request-id': nextId,
23
24
  },
24
25
  },
25
26
  handler,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "6.2.32",
3
+ "version": "6.2.34",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",