react-devbelt 0.4.0 → 0.4.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.
@@ -1215,16 +1215,21 @@ function installFetchLog() {
1215
1215
  let id = null;
1216
1216
  const startedAt = performance.now();
1217
1217
  try {
1218
- const request = new Request(input, init);
1218
+ const source = typeof Request !== "undefined" && input instanceof Request;
1219
+ const headers = new Headers(source ? input.headers : void 0);
1220
+ new Headers(init?.headers).forEach(
1221
+ (value, name) => headers.set(name, value)
1222
+ );
1223
+ const rawUrl = source ? input.url : input instanceof URL ? input.href : String(input);
1219
1224
  id = add({
1220
- method: request.method.toUpperCase(),
1221
- url: new URL(request.url, window.location.href).href,
1225
+ method: (init?.method ?? (source ? input.method : "GET")).toUpperCase(),
1226
+ url: new URL(rawUrl, window.location.href).href,
1222
1227
  status: null,
1223
1228
  startedAt: Date.now(),
1224
1229
  duration: null,
1225
1230
  pageUrl: window.location.href,
1226
1231
  viewport: describeViewport(),
1227
- requestHeaders: headersToRecord(request.headers),
1232
+ requestHeaders: headersToRecord(headers),
1228
1233
  // Only what the caller passed as `init.body` is read back; a Request
1229
1234
  // body is a stream and cannot be read without consuming it.
1230
1235
  requestBody: capInMemory(serializeBody(init?.body)),
@@ -8158,4 +8163,4 @@ export {
8158
8163
  storage,
8159
8164
  defaultPlugins
8160
8165
  };
8161
- //# sourceMappingURL=chunk-SYBN2CEO.js.map
8166
+ //# sourceMappingURL=chunk-VVSEYZHW.js.map