@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.cjs.js
CHANGED
|
@@ -1251,7 +1251,7 @@ async function fonts(_req, res, { getFonts } = {}) {
|
|
|
1251
1251
|
const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
|
|
1252
1252
|
return res.json(fonts2);
|
|
1253
1253
|
}
|
|
1254
|
-
const version = "0.
|
|
1254
|
+
const version = "0.12.1";
|
|
1255
1255
|
async function handler(req, res, { apiKey, siteVersions }) {
|
|
1256
1256
|
if (req.query.secret !== apiKey) {
|
|
1257
1257
|
return res.status(401).json({ message: "Unauthorized" });
|
|
@@ -1269,12 +1269,13 @@ async function handler(req, res, { apiKey, siteVersions }) {
|
|
|
1269
1269
|
});
|
|
1270
1270
|
}
|
|
1271
1271
|
async function proxyPreviewMode(req, res, { apiKey }) {
|
|
1272
|
+
var _a, _b;
|
|
1272
1273
|
const previewModeProxy = httpProxy.createProxyServer();
|
|
1273
1274
|
const NextRequestMetaSymbol = Reflect.ownKeys(req).find((key) => key.toString() === "Symbol(NextRequestMeta)" || key.toString() === "Symbol(NextInternalRequestMeta)");
|
|
1274
1275
|
if (NextRequestMetaSymbol) {
|
|
1275
1276
|
const nextRequestMeta = req[NextRequestMetaSymbol];
|
|
1276
|
-
const initUrl = nextRequestMeta == null ? void 0 : nextRequestMeta.__NEXT_INIT_URL;
|
|
1277
|
-
const isLocaleStripped = nextRequestMeta == null ? void 0 : nextRequestMeta.__nextStrippedLocale;
|
|
1277
|
+
const initUrl = (_a = nextRequestMeta == null ? void 0 : nextRequestMeta.__NEXT_INIT_URL) != null ? _a : nextRequestMeta == null ? void 0 : nextRequestMeta.initURL;
|
|
1278
|
+
const isLocaleStripped = (_b = nextRequestMeta == null ? void 0 : nextRequestMeta.__nextStrippedLocale) != null ? _b : nextRequestMeta == null ? void 0 : nextRequestMeta.didStripLocale;
|
|
1278
1279
|
try {
|
|
1279
1280
|
if (isLocaleStripped && initUrl)
|
|
1280
1281
|
req.url = new URL(initUrl).pathname;
|