@decocms/start 1.4.3 → 1.4.4
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/bun.lock +1496 -0
- package/package.json +1 -1
- package/src/admin/render.ts +10 -1
- package/src/index.ts +1 -0
package/package.json
CHANGED
package/src/admin/render.ts
CHANGED
|
@@ -121,11 +121,20 @@ export async function handleRender(request: Request): Promise<Response> {
|
|
|
121
121
|
const url = new URL(request.url);
|
|
122
122
|
const resolveChain = url.searchParams.get("resolveChain");
|
|
123
123
|
const propsParam = url.searchParams.get("props");
|
|
124
|
+
console.log("handleRender", request.url);
|
|
124
125
|
|
|
125
126
|
const pathPrefix = "/live/previews/";
|
|
126
|
-
const
|
|
127
|
+
const rawPathComponent = url.pathname.startsWith(pathPrefix)
|
|
127
128
|
? url.pathname.slice(pathPrefix.length)
|
|
128
129
|
: "";
|
|
130
|
+
// Admin sends double-encoded path segments (e.g. space → %20 → %2520).
|
|
131
|
+
// Decode until stable so the block key matches the decofile.
|
|
132
|
+
const pathComponent = (() => {
|
|
133
|
+
try {
|
|
134
|
+
const once = decodeURIComponent(rawPathComponent);
|
|
135
|
+
try { return decodeURIComponent(once); } catch { return once; }
|
|
136
|
+
} catch { return rawPathComponent; }
|
|
137
|
+
})();
|
|
129
138
|
let component = resolveChain || pathComponent || "";
|
|
130
139
|
let props: Record<string, unknown> = {};
|
|
131
140
|
let decofileOverride: Record<string, unknown> | null = null;
|
package/src/index.ts
CHANGED