@makeswift/runtime 0.11.19 → 0.12.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.es.js CHANGED
@@ -1218,7 +1218,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1218
1218
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1219
1219
  return res.json(fonts2);
1220
1220
  }
1221
- const version = "0.11.19";
1221
+ const version = "0.12.1";
1222
1222
  async function handler(req, res, { apiKey, siteVersions }) {
1223
1223
  if (req.query.secret !== apiKey) {
1224
1224
  return res.status(401).json({ message: "Unauthorized" });
@@ -1236,12 +1236,13 @@ async function handler(req, res, { apiKey, siteVersions }) {
1236
1236
  });
1237
1237
  }
1238
1238
  async function proxyPreviewMode(req, res, { apiKey }) {
1239
+ var _a, _b;
1239
1240
  const previewModeProxy = createProxyServer();
1240
1241
  const NextRequestMetaSymbol = Reflect.ownKeys(req).find((key) => key.toString() === "Symbol(NextRequestMeta)" || key.toString() === "Symbol(NextInternalRequestMeta)");
1241
1242
  if (NextRequestMetaSymbol) {
1242
1243
  const nextRequestMeta = req[NextRequestMetaSymbol];
1243
- const initUrl = nextRequestMeta == null ? void 0 : nextRequestMeta.__NEXT_INIT_URL;
1244
- const isLocaleStripped = nextRequestMeta == null ? void 0 : nextRequestMeta.__nextStrippedLocale;
1244
+ const initUrl = (_a = nextRequestMeta == null ? void 0 : nextRequestMeta.__NEXT_INIT_URL) != null ? _a : nextRequestMeta == null ? void 0 : nextRequestMeta.initURL;
1245
+ const isLocaleStripped = (_b = nextRequestMeta == null ? void 0 : nextRequestMeta.__nextStrippedLocale) != null ? _b : nextRequestMeta == null ? void 0 : nextRequestMeta.didStripLocale;
1245
1246
  try {
1246
1247
  if (isLocaleStripped && initUrl)
1247
1248
  req.url = new URL(initUrl).pathname;