@makeswift/runtime 0.2.5 → 0.2.6

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
@@ -1002,7 +1002,7 @@ class Document$1 extends NextDocument__default["default"] {
1002
1002
  });
1003
1003
  }
1004
1004
  }
1005
- const version = "0.2.5";
1005
+ const version = "0.2.6";
1006
1006
  function MakeswiftApiHandler(apiKey, { appOrigin = "https://app.makeswift.com", getFonts } = {}) {
1007
1007
  const cors = Cors__default["default"]({ origin: appOrigin });
1008
1008
  const previewModeProxy = httpProxy.createProxyServer();
@@ -1070,7 +1070,10 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
1070
1070
  if (host == null)
1071
1071
  return res.status(400).send("Bad Request");
1072
1072
  const forwardedProto = req.headers["x-forwarded-proto"];
1073
- const proto = typeof forwardedProto === "string" ? forwardedProto : "http";
1073
+ const isForwardedProtoHttps = typeof forwardedProto === "string" && forwardedProto === "https";
1074
+ const forwardedSSL = req.headers["x-forwarded-ssl"];
1075
+ const isForwardedSSL = typeof forwardedSSL === "string" && forwardedSSL === "on";
1076
+ const proto = isForwardedProtoHttps || isForwardedSSL ? "https" : "http";
1074
1077
  let target = `${proto}://${host}`;
1075
1078
  if (process.env["NODE_ENV"] !== "production") {
1076
1079
  const port = req.socket.localPort;