@makeswift/runtime 0.2.17 → 0.2.19

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/index.es.js CHANGED
@@ -891,11 +891,17 @@ if (window.parent !== window) {
891
891
  } else {
892
892
  const originalFetch = window.fetch
893
893
 
894
- window.fetch = function patchedFetch(input, init) {
895
- return originalFetch.call(this, input, {
896
- ...init,
897
- headers: { ...init?.headers, [headerName]: secret },
898
- })
894
+ window.fetch = function patchedFetch(resource, options) {
895
+ const request = new Request(resource, options)
896
+
897
+ if (new URL(request.url).origin !== window.location.origin) {
898
+ return originalFetch.call(this, resource, options)
899
+ }
900
+
901
+ return originalFetch.call(
902
+ this,
903
+ new Request(request, { headers: { [headerName]: secret } }),
904
+ )
899
905
  }
900
906
  }
901
907
  }
@@ -966,7 +972,7 @@ class Document$1 extends NextDocument {
966
972
  });
967
973
  }
968
974
  }
969
- const version = "0.2.17";
975
+ const version = "0.2.19";
970
976
  function isErrorWithMessage(error) {
971
977
  return typeof error === "object" && error !== null && "message" in error && typeof error.message === "string";
972
978
  }