@ricsam/isolate-client 0.1.21 → 0.1.22

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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/isolate-client",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "commonjs"
5
5
  }
@@ -1047,6 +1047,7 @@ function registerConsoleCallbacks(state, callbacks) {
1047
1047
  return registrations;
1048
1048
  }
1049
1049
  var CALLBACK_STREAM_THRESHOLD = 64 * 1024;
1050
+ var NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
1050
1051
  function registerFetchCallback(state, callback) {
1051
1052
  const callbackId = state.nextCallbackId++;
1052
1053
  state.callbacksNeedingRequestId.add(callbackId);
@@ -1067,7 +1068,7 @@ function registerFetchCallback(state, callback) {
1067
1068
  const contentLength = response.headers.get("content-length");
1068
1069
  const knownSize = contentLength ? parseInt(contentLength, 10) : null;
1069
1070
  const isNetworkResponse = response.url && (response.url.startsWith("http://") || response.url.startsWith("https://"));
1070
- const shouldStream = isNetworkResponse && response.body && (knownSize === null || knownSize > CALLBACK_STREAM_THRESHOLD);
1071
+ const shouldStream = isNetworkResponse && !NULL_BODY_STATUSES.has(response.status) && !!response.body && (knownSize === null || knownSize > CALLBACK_STREAM_THRESHOLD);
1071
1072
  if (shouldStream && response.body) {
1072
1073
  const streamId = state.nextStreamId++;
1073
1074
  const headers = [];
@@ -1694,4 +1695,4 @@ export {
1694
1695
  connect
1695
1696
  };
1696
1697
 
1697
- //# debugId=17E01CA2373935E664756E2164756E21
1698
+ //# debugId=F239739EEADB58BD64756E2164756E21