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
+2 -1
View File
@@ -330,7 +330,8 @@ Query: `?q=` (wymagane), `?locale=`, `?limit=`. Odpowiedź:
"results": [{ "title": "O nas", "url": "https://x/pl/o-nas", "description": "…", "slug": "o-nas" }] }
```
Brak `q` → 400. Tylko opublikowane, bez `noindex`, maks. 50 wyników. Błąd/baza
Brak `q` → 400. Tylko opublikowane, bez `noindex`, maks. 50 wyników. Tryb „w budowie”:
przekaż `isPathVisible` z `createContentHelpers`, a ukryte strony znikną z wyników. Błąd/baza
offline → pusty wynik (200), nie 500. **Limit zapytań:** 120/min na IP (w pamięci,
per instancja) → `429` z `Retry-After`; zmiana: `rateLimit: { max, windowMs }`,
wyłączenie (limiter z przodu, np. Cloudflare WAF): `rateLimit: false`.