@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.
- package/next/site-proxy.js +9 -1
- package/package.json +1 -1
package/next/site-proxy.js
CHANGED
|
@@ -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
|
-
|
|
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");
|