@phis/ui 0.2.0 → 0.2.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.
@@ -111,7 +111,15 @@ async function resolvePhiStaticRenderUrl(request, runtimeConfig) {
111
111
  .map((part) => String(part).replace(/[^A-Za-z0-9-]/g, "_"))
112
112
  .join(".");
113
113
  const mode = resolvePhiThemeMode(normalizePhiThemeModePreference(request.cookies.get(PHI_THEME_MODE_COOKIE)?.value), normalizePhiColorSchemeHint(request.cookies.get(PHI_COLOR_SCHEME_COOKIE)?.value));
114
- return new URL(`${PHI_STATIC_RENDER_PREFIX}/${marker}/${mode}${request.nextUrl.pathname}`, request.url);
114
+ const url = new URL(`${PHI_STATIC_RENDER_PREFIX}/${marker}/${mode}${request.nextUrl.pathname}`, request.url);
115
+ /*
116
+ * Plain HTTP, whatever the visitor's request said. Behind a proxy that terminates TLS the request
117
+ * arrives as `https` through `X-Forwarded-Proto`, and wherever Next counts this rewrite as external (see
118
+ * `readPhiStaticRenderPass`) it fetches the address from this process -- which speaks HTTP only, so an
119
+ * `https` address failed every Public page with a TLS error and a 500.
120
+ */
121
+ url.protocol = "http:";
122
+ return url;
115
123
  }
116
124
  const PHI_STATIC_RENDER_PASS_HEADER = "x-phis-static-render";
117
125
  const PHI_STATIC_RENDER_PASS_KEY = Symbol.for("phis-ui.static-render-pass");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phis/ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"