generated from coulomb/repo-seed
fix(api): normalize trailing slashes — no slash on param routes
Rule: trailing slash only on collection roots (/). Any route containing
a path parameter {…} uses no trailing slash. Applies across all routers,
scripts, Makefile, and tests. Fixes 307-redirect fragility on POST/PATCH
from naive clients (curl, Codex HTTP calls).
Also adds POST /repos/{slug}/sync — runs ADR-001 consistency check with
--fix via HTTP, so non-MCP agents (Codex) can self-service DB sync without
operator intervention.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@ resolve_path() {
|
||||
local slug="$1"
|
||||
# Try the registered local_path first
|
||||
local api_path
|
||||
api_path=$(curl -sf "${API_BASE}/repos/${slug}/" | python3 -c \
|
||||
api_path=$(curl -sf "${API_BASE}/repos/${slug}" | python3 -c \
|
||||
"import json,sys; d=json.load(sys.stdin); print(d.get('local_path') or '')" 2>/dev/null || true)
|
||||
if [[ -n "$api_path" && -d "$api_path" ]]; then
|
||||
echo "$api_path"
|
||||
|
||||
Reference in New Issue
Block a user