@nxtedition/nxt-undici 6.0.0 → 6.0.1
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/interceptor/cache.js
CHANGED
|
@@ -161,7 +161,7 @@ export default () => (dispatch) => (opts, handler) => {
|
|
|
161
161
|
try {
|
|
162
162
|
handler.onConnect(abort)
|
|
163
163
|
if (aborted) {
|
|
164
|
-
return
|
|
164
|
+
return
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
if (handler.onHeaders(statusCode, headers, resume) === false) {
|
|
@@ -169,7 +169,7 @@ export default () => (dispatch) => (opts, handler) => {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
if (aborted) {
|
|
172
|
-
return
|
|
172
|
+
return
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
if (!paused) {
|
|
@@ -178,6 +178,4 @@ export default () => (dispatch) => (opts, handler) => {
|
|
|
178
178
|
} catch (err) {
|
|
179
179
|
abort(err)
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
return true
|
|
183
181
|
}
|
package/lib/interceptor/proxy.js
CHANGED
|
@@ -5,17 +5,16 @@ export default () => (dispatch) => (opts, handler) => {
|
|
|
5
5
|
|
|
6
6
|
const body = opts.body({ signal: opts.signal })
|
|
7
7
|
|
|
8
|
-
if (typeof body?.then
|
|
9
|
-
body.then(
|
|
10
|
-
(body) => {
|
|
11
|
-
dispatch({ ...opts, body }, handler)
|
|
12
|
-
},
|
|
13
|
-
(err) => {
|
|
14
|
-
handler.onError(err)
|
|
15
|
-
},
|
|
16
|
-
)
|
|
17
|
-
return true
|
|
18
|
-
} else {
|
|
8
|
+
if (typeof body?.then !== 'function') {
|
|
19
9
|
return dispatch({ ...opts, body }, handler)
|
|
20
10
|
}
|
|
11
|
+
|
|
12
|
+
body.then(
|
|
13
|
+
(body) => {
|
|
14
|
+
dispatch({ ...opts, body }, handler)
|
|
15
|
+
},
|
|
16
|
+
(err) => {
|
|
17
|
+
handler.onError(err)
|
|
18
|
+
},
|
|
19
|
+
)
|
|
21
20
|
}
|