@thecms/next 0.20.4-dev.134 → 0.20.4-dev.137
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/server.d.ts +3 -2
- package/dist/server.js +4 -2
- package/package.json +2 -2
package/dist/server.d.ts
CHANGED
|
@@ -173,7 +173,7 @@ interface CmsPageProps {
|
|
|
173
173
|
searchParams?: Promise<Record<string, string | string[] | undefined>>;
|
|
174
174
|
}
|
|
175
175
|
/** SITE-CONNECTION (D266): this package's version, as the site's server announces it (kept equal to package.json by a test). */
|
|
176
|
-
declare const NEXT_VERSION = "0.20.4-dev.
|
|
176
|
+
declare const NEXT_VERSION = "0.20.4-dev.137";
|
|
177
177
|
/** The reader's session (D192) and the preview token (D190, P7: valid for the preview route only): httpOnly cookies of the site. */
|
|
178
178
|
declare const READER_COOKIE = "cms_reader";
|
|
179
179
|
|
|
@@ -181,7 +181,8 @@ declare const READER_COOKIE = "cms_reader";
|
|
|
181
181
|
* LLMS-PROXY (24/11/2026): where the site's own page is asked — first at the application's Site URL when the request
|
|
182
182
|
* reached the server at its host (the address its visitors use: behind a reverse proxy that ends TLS, the public
|
|
183
183
|
* https one; LLMS-OWN: never another host, which may be another site), then as this request reached the server,
|
|
184
|
-
* with the proxy's forwarded scheme (`X-Forwarded-Proto`: the same host, never another one), then `req.url` as it is
|
|
184
|
+
* with the proxy's forwarded scheme (`X-Forwarded-Proto`: the same host, never another one), then `req.url` as it is,
|
|
185
|
+
* then the same host in plain http (the server's own port).
|
|
185
186
|
* Never a host taken from a request header to BUILD an address: a forged `X-Forwarded-Host` would make the site read,
|
|
186
187
|
* and keep as its own text, another site's page. (MULTISITE D638: the `Host` header only CHOOSES among the declared
|
|
187
188
|
* sites — an undeclared host never gets here — and the pages' addresses are the Site URL's.)
|
package/dist/server.js
CHANGED
|
@@ -597,7 +597,7 @@ function findTag(el, tag) {
|
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
// src/server.ts
|
|
600
|
-
var NEXT_VERSION = "0.20.4-dev.
|
|
600
|
+
var NEXT_VERSION = "0.20.4-dev.137";
|
|
601
601
|
var READER_COOKIE = "cms_reader";
|
|
602
602
|
var ENTRY_URL = "/api/cms/preview";
|
|
603
603
|
function decodeSegment(segment) {
|
|
@@ -611,16 +611,18 @@ var fromNowhere = (h) => h.get(UNKNOWN_VISITOR_HEADER)?.trim().toLowerCase() ===
|
|
|
611
611
|
function sitePageOrigins(req, siteUrl) {
|
|
612
612
|
const url = new URL(req.url);
|
|
613
613
|
const origins = [];
|
|
614
|
+
const host = req.headers.get("host");
|
|
614
615
|
if (siteUrl) {
|
|
615
616
|
try {
|
|
616
617
|
const own = new URL(siteUrl);
|
|
617
|
-
if (own.host === url.host) origins.push(own.origin);
|
|
618
|
+
if (own.host === url.host || own.host === host) origins.push(own.origin);
|
|
618
619
|
} catch {
|
|
619
620
|
}
|
|
620
621
|
}
|
|
621
622
|
const proto = req.headers.get("x-forwarded-proto")?.split(",")[0]?.trim().replace(/:$/, "");
|
|
622
623
|
if (proto === "https" || proto === "http") origins.push(`${proto}://${url.host}`);
|
|
623
624
|
origins.push(url.origin);
|
|
625
|
+
origins.push(`http://${url.host}`);
|
|
624
626
|
return [...new Set(origins)];
|
|
625
627
|
}
|
|
626
628
|
function sameAddress(from, location) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecms/next",
|
|
3
|
-
"version": "0.20.4-dev.
|
|
3
|
+
"version": "0.20.4-dev.137",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "theCMS. for Next.js (App Router): pages, metadata, the blocks drawn with the site's components, preview, readers and an optional one-line route",
|
|
6
6
|
"type": "module",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react": ">=19"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thecms/sdk": "0.20.4-dev.
|
|
43
|
+
"@thecms/sdk": "0.20.4-dev.137"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@thecms/core": "0.0.1",
|