@zimic/interceptor 1.0.0-rc.4 → 1.0.0-rc.5
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/dist/{chunk-CZIDAF2X.mjs → chunk-7DRPXOOJ.mjs} +2 -2
- package/dist/{chunk-CZIDAF2X.mjs.map → chunk-7DRPXOOJ.mjs.map} +1 -1
- package/dist/{chunk-P23SDDCC.js → chunk-LWUFSWRA.js} +2 -2
- package/dist/{chunk-P23SDDCC.js.map → chunk-LWUFSWRA.js.map} +1 -1
- package/dist/cli.js +18 -18
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/http.js +8 -5
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +8 -5
- package/dist/http.mjs.map +1 -1
- package/dist/server.js +6 -6
- package/dist/server.mjs +1 -1
- package/package.json +3 -3
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +4 -1
- package/src/utils/data.ts +10 -7
package/dist/http.mjs
CHANGED
|
@@ -563,11 +563,11 @@ async function convertReadableStreamToBlob(stream, options) {
|
|
|
563
563
|
const chunks = [];
|
|
564
564
|
const reader = stream.getReader();
|
|
565
565
|
while (true) {
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
chunks.push(
|
|
566
|
+
const result = await reader.read();
|
|
567
|
+
if (result.value) {
|
|
568
|
+
chunks.push(result.value);
|
|
569
569
|
}
|
|
570
|
-
if (
|
|
570
|
+
if (result.done) {
|
|
571
571
|
break;
|
|
572
572
|
}
|
|
573
573
|
}
|
|
@@ -823,7 +823,10 @@ var HttpRequestHandlerClient = class {
|
|
|
823
823
|
if (restrictionBody instanceof ArrayBuffer) {
|
|
824
824
|
restrictionBodyAsBlob = convertArrayBufferToBlob(restrictionBody, { type: body.type });
|
|
825
825
|
} else if (restrictionBody instanceof ReadableStream) {
|
|
826
|
-
restrictionBodyAsBlob = await convertReadableStreamToBlob(
|
|
826
|
+
restrictionBodyAsBlob = await convertReadableStreamToBlob(
|
|
827
|
+
restrictionBody,
|
|
828
|
+
{ type: body.type }
|
|
829
|
+
);
|
|
827
830
|
} else {
|
|
828
831
|
restrictionBodyAsBlob = restrictionBody;
|
|
829
832
|
}
|