Construction mode hides pages from Markdown, MCP and search; MCP rejects non-object messages
createContentHelpers exposes isPathVisible (built from getConstructionMode) and passes it to markdownRoute and mcpPOST; createSearchRoute, createMcpRoute and createMarkdownRoute accept it. A null/number/string JSON-RPC message now gets -32600 instead of crashing the route. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9a72ebfaff
commit
7c05a1dba9
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Is this public page path served right now? createContentHelpers builds it from
|
||||
* Site Settings → Under construction (`isPathVisible`), so the Markdown, MCP and
|
||||
* search routes hide exactly what the page route hides. Paths are page paths as
|
||||
* a visitor sees them ('/pl/o-nas', or '/o-nas' on a single-language site).
|
||||
*/
|
||||
export type PathVisibility = (path: string, locale: string) => boolean | Promise<boolean>
|
||||
|
||||
/** Pathname of a result URL (absolute or relative), for a PathVisibility check. */
|
||||
export const pathOf = (url: string): string => new URL(url, 'http://localhost').pathname
|
||||
Reference in New Issue
Block a user