@sanity/client 7.5.0-live-cors.3 → 7.6.0

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,30 +1289,17 @@ class LiveClient {
1289
1289
  }
1290
1290
  return event;
1291
1291
  })
1292
- );
1293
- console.log("YES THIS IS THE CORS VERSION with the allowed origin check");
1294
- const isAllowedOrigin = (origin2) => [
1295
- /^http:\/\/localhost:/,
1296
- /^http:\/\/127\.0\.0\.1:/,
1297
- /^https:\/\/[^.]*\.sanity\.studio$/,
1298
- /^https:\/\/[^.]*\.studio\.sanity\.work$/,
1299
- /^https:\/\/[^.]*\.sanity\.work$/,
1300
- /^https:\/\/[^.]*\.sanity\.io$/
1301
- ].some((pattern) => pattern.test(origin2)), checkCors = fetchObservable(url, {
1292
+ ), checkCors = fetchObservable(url, {
1302
1293
  method: "OPTIONS",
1303
1294
  mode: "cors",
1304
1295
  credentials: esOptions.withCredentials ? "include" : "omit",
1305
- headers: {
1306
- ...esOptions.headers,
1307
- "Access-Control-Request-Headers": "authorization"
1308
- // for this preflight check, ensure we send what the browser would send if needed
1309
- }
1296
+ headers: esOptions.headers
1310
1297
  }).pipe(
1311
1298
  rxjs.mergeMap(() => rxjs.EMPTY),
1312
1299
  rxjs.catchError(() => {
1313
1300
  throw new CorsOriginError({ projectId });
1314
1301
  })
1315
- ), origin = typeof location < "u" ? location.origin : "", observable = (isAllowedOrigin(origin) ? events : rxjs.concat(checkCors, events)).pipe(
1302
+ ), observable = rxjs.concat(checkCors, events).pipe(
1316
1303
  operators.finalize(() => eventsCache.delete(key)),
1317
1304
  shareReplayLatest({
1318
1305
  predicate: (event) => event.type === "welcome"
@@ -2537,7 +2524,7 @@ function defineDeprecatedCreateClient(createClient2) {
2537
2524
  return config.printNoDefaultExport(), createClient2(config$1);
2538
2525
  };
2539
2526
  }
2540
- var name = "@sanity/client", version = "7.5.0-live-cors.3";
2527
+ var name = "@sanity/client", version = "7.6.0";
2541
2528
  const middleware = [
2542
2529
  middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
2543
2530
  middleware$1.headers({ "User-Agent": `${name} ${version}` }),