@nxtedition/nxt-undici 6.1.5 → 6.1.6
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 +17 -13
- package/package.json +1 -1
package/lib/interceptor/cache.js
CHANGED
|
@@ -190,22 +190,26 @@ export default () => (dispatch) => (opts, handler) => {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
handler.onHeaders(statusCode, headers, NOOP)
|
|
199
|
-
if (aborted) {
|
|
200
|
-
return
|
|
201
|
-
}
|
|
193
|
+
try {
|
|
194
|
+
handler.onConnect(abort)
|
|
195
|
+
if (aborted) {
|
|
196
|
+
return
|
|
197
|
+
}
|
|
202
198
|
|
|
203
|
-
|
|
204
|
-
handler.onData(body)
|
|
199
|
+
handler.onHeaders(statusCode, headers, NOOP)
|
|
205
200
|
if (aborted) {
|
|
206
201
|
return
|
|
207
202
|
}
|
|
208
|
-
}
|
|
209
203
|
|
|
210
|
-
|
|
204
|
+
if (body?.byteLength) {
|
|
205
|
+
handler.onData(body)
|
|
206
|
+
if (aborted) {
|
|
207
|
+
return
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
handler.onComplete({})
|
|
212
|
+
} catch (err) {
|
|
213
|
+
abort(err)
|
|
214
|
+
}
|
|
211
215
|
}
|