@sanity/client 7.4.1 → 7.5.0-live-cors.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.
package/dist/index.cjs CHANGED
@@ -1289,11 +1289,17 @@ class LiveClient {
1289
1289
  }
1290
1290
  return event;
1291
1291
  })
1292
- ), checkCors = fetchObservable(url, {
1292
+ );
1293
+ console.log("YES THIS IS THE CORS VERSION");
1294
+ const checkCors = fetchObservable(url, {
1293
1295
  method: "OPTIONS",
1294
1296
  mode: "cors",
1295
1297
  credentials: esOptions.withCredentials ? "include" : "omit",
1296
- headers: esOptions.headers
1298
+ headers: {
1299
+ ...esOptions.headers,
1300
+ "Access-Control-Request-Headers": "authorization"
1301
+ // for this preflight check, ensure we send what the browser would send if needed
1302
+ }
1297
1303
  }).pipe(
1298
1304
  rxjs.mergeMap(() => rxjs.EMPTY),
1299
1305
  rxjs.catchError(() => {
@@ -2524,7 +2530,7 @@ function defineDeprecatedCreateClient(createClient2) {
2524
2530
  return config.printNoDefaultExport(), createClient2(config$1);
2525
2531
  };
2526
2532
  }
2527
- var name = "@sanity/client", version = "7.4.1";
2533
+ var name = "@sanity/client", version = "7.5.0-live-cors.1";
2528
2534
  const middleware = [
2529
2535
  middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
2530
2536
  middleware$1.headers({ "User-Agent": `${name} ${version}` }),