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:
Radosław Smoliński
2026-10-22 17:07:45 +02:00
co-authored by Claude Opus 5.5
parent 9a72ebfaff
commit 7c05a1dba9
11 changed files with 116 additions and 13 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ export async function submitForm({
// 1. Rate limit — cheapest gate, drops a flood before any real work.
// No IP → the limiter's shared "unknown" bucket, never a free pass.
if (maxPerMinute > 0) {
if (!(await consumeRateLimit({ key: ip, max: maxPerMinute })).ok) {
if (!(await consumeRateLimit({ key: ip ?? '', max: maxPerMinute })).ok) {
return { reason: 'rate_limited', success: false }
}
}