@nxtedition/nxt-undici 7.2.2 → 7.2.3

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.
Files changed (2) hide show
  1. package/lib/index.js +10 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -124,6 +124,16 @@ function wrapDispatch(dispatcher) {
124
124
  throw new TypeError('invalid opts.priority')
125
125
  }
126
126
 
127
+ if (priority == null && headers['nxt-priority']) {
128
+ if (headers['nxt-priority'] === 'low' || headers['nxt-priority'] === '0') {
129
+ priority = 0
130
+ } else if (headers['nxt-priority'] === 'normal' || headers['nxt-priority'] === '1') {
131
+ priority = 1
132
+ } else if (headers['nxt-priority'] === 'high' || headers['nxt-priority'] === '2') {
133
+ priority = 2
134
+ }
135
+ }
136
+
127
137
  if (globalThis.__nxt_undici_global_headers) {
128
138
  Object.assign(headers, globalThis.__nxt_undici_global_headers)
129
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "7.2.2",
3
+ "version": "7.2.3",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",