msw 2.4.5 → 2.4.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.
@@ -370,7 +370,7 @@ You can also automate this process and make the worker script update automatical
370
370
  }
371
371
  }
372
372
 
373
- // node_modules/.pnpm/@mswjs+interceptors@0.35.0/node_modules/@mswjs/interceptors/lib/browser/chunk-6HYIRFX2.mjs
373
+ // node_modules/.pnpm/@mswjs+interceptors@0.35.3/node_modules/@mswjs/interceptors/lib/browser/chunk-6HYIRFX2.mjs
374
374
  var encoder = new TextEncoder();
375
375
  function encodeBuffer(text) {
376
376
  return encoder.encode(text);
@@ -386,7 +386,7 @@ function toArrayBuffer(array) {
386
386
  );
387
387
  }
388
388
 
389
- // node_modules/.pnpm/@mswjs+interceptors@0.35.0/node_modules/@mswjs/interceptors/lib/browser/chunk-XVPRNJO7.mjs
389
+ // node_modules/.pnpm/@mswjs+interceptors@0.35.3/node_modules/@mswjs/interceptors/lib/browser/chunk-XVPRNJO7.mjs
390
390
  var IS_PATCHED_MODULE = Symbol("isPatchedModule");
391
391
  function isPropertyAccessible(obj, key) {
392
392
  try {
@@ -956,7 +956,7 @@ var _Emitter = class {
956
956
  var Emitter = _Emitter;
957
957
  Emitter.defaultMaxListeners = 10;
958
958
 
959
- // node_modules/.pnpm/@mswjs+interceptors@0.35.0/node_modules/@mswjs/interceptors/lib/browser/chunk-QED3Q6Z2.mjs
959
+ // node_modules/.pnpm/@mswjs+interceptors@0.35.3/node_modules/@mswjs/interceptors/lib/browser/chunk-QED3Q6Z2.mjs
960
960
  var INTERNAL_REQUEST_ID_HEADER_NAME = "x-interceptors-internal-request-id";
961
961
  function getGlobalSymbol(symbol) {
962
962
  return (
@@ -1104,7 +1104,7 @@ function createRequestId() {
1104
1104
  return Math.random().toString(16).slice(2);
1105
1105
  }
1106
1106
 
1107
- // node_modules/.pnpm/@mswjs+interceptors@0.35.0/node_modules/@mswjs/interceptors/lib/browser/index.mjs
1107
+ // node_modules/.pnpm/@mswjs+interceptors@0.35.3/node_modules/@mswjs/interceptors/lib/browser/index.mjs
1108
1108
  var BatchInterceptor = class extends Interceptor {
1109
1109
  constructor(options) {
1110
1110
  BatchInterceptor.symbol = Symbol(options.name);
@@ -1388,7 +1388,7 @@ var DeferredPromise = class extends Promise {
1388
1388
  }
1389
1389
  };
1390
1390
 
1391
- // node_modules/.pnpm/@mswjs+interceptors@0.35.0/node_modules/@mswjs/interceptors/lib/browser/chunk-THPGBWJQ.mjs
1391
+ // node_modules/.pnpm/@mswjs+interceptors@0.35.3/node_modules/@mswjs/interceptors/lib/browser/chunk-THPGBWJQ.mjs
1392
1392
  var InterceptorError = class extends Error {
1393
1393
  constructor(message) {
1394
1394
  super(message);
@@ -1556,7 +1556,7 @@ async function handleRequest2(options) {
1556
1556
  return false;
1557
1557
  }
1558
1558
 
1559
- // node_modules/.pnpm/@mswjs+interceptors@0.35.0/node_modules/@mswjs/interceptors/lib/browser/chunk-DZCGGRSJ.mjs
1559
+ // node_modules/.pnpm/@mswjs+interceptors@0.35.3/node_modules/@mswjs/interceptors/lib/browser/chunk-G5SOR3ND.mjs
1560
1560
  function canParseUrl(url) {
1561
1561
  try {
1562
1562
  new URL(url);
@@ -1585,7 +1585,7 @@ async function followFetchRedirect(request, response) {
1585
1585
  const requestUrl = new URL(request.url);
1586
1586
  let locationUrl;
1587
1587
  try {
1588
- locationUrl = new URL(response.headers.get("location"));
1588
+ locationUrl = new URL(response.headers.get("location"), request.url);
1589
1589
  } catch (error2) {
1590
1590
  return Promise.reject(createNetworkError(error2));
1591
1591
  }
@@ -1753,7 +1753,7 @@ var _FetchInterceptor = class extends Interceptor {
1753
1753
  var FetchInterceptor = _FetchInterceptor;
1754
1754
  FetchInterceptor.symbol = Symbol("fetch");
1755
1755
 
1756
- // node_modules/.pnpm/@mswjs+interceptors@0.35.0/node_modules/@mswjs/interceptors/lib/browser/chunk-PRBA3ES4.mjs
1756
+ // node_modules/.pnpm/@mswjs+interceptors@0.35.3/node_modules/@mswjs/interceptors/lib/browser/chunk-SUQ32ZQK.mjs
1757
1757
  function concatArrayBuffer(left, right) {
1758
1758
  const result = new Uint8Array(left.byteLength + right.byteLength);
1759
1759
  result.set(left, 0);
@@ -2027,7 +2027,7 @@ var XMLHttpRequestController = class {
2027
2027
  });
2028
2028
  const requestBody = typeof body === "string" ? encodeBuffer(body) : body;
2029
2029
  const fetchRequest = this.toFetchApiRequest(requestBody);
2030
- this[kFetchRequest] = fetchRequest;
2030
+ this[kFetchRequest] = fetchRequest.clone();
2031
2031
  const onceRequestSettled = ((_a = this.onRequest) == null ? void 0 : _a.call(this, {
2032
2032
  request: fetchRequest,
2033
2033
  requestId: this.requestId
@@ -2109,7 +2109,7 @@ var XMLHttpRequestController = class {
2109
2109
  this[kIsRequestHandled] = true;
2110
2110
  if (this[kFetchRequest]) {
2111
2111
  const totalRequestBodyLength = await getBodyByteLength(
2112
- this[kFetchRequest].clone()
2112
+ this[kFetchRequest]
2113
2113
  );
2114
2114
  this.trigger("loadstart", this.request.upload, {
2115
2115
  loaded: 0,