xpe 1.0.9 → 1.0.10
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.
|
@@ -2,7 +2,10 @@ export function createRuntimeFetch(runtimeCredentials, browserFetch = window.fet
|
|
|
2
2
|
if (!runtimeCredentials)
|
|
3
3
|
return undefined;
|
|
4
4
|
return (input, init) => {
|
|
5
|
-
|
|
5
|
+
// Request objects created inside an XPE child iframe belong to another
|
|
6
|
+
// JavaScript Realm, so `input instanceof Request` is false in the Host.
|
|
7
|
+
// RequestInfo is Request|string; use the contract shape instead.
|
|
8
|
+
const requestCredentials = typeof input === "string" ? undefined : input.credentials;
|
|
6
9
|
return browserFetch(input, {
|
|
7
10
|
...init,
|
|
8
11
|
credentials: init?.credentials ?? requestCredentials ?? runtimeCredentials,
|