trackslash
TRACK-47 P3

Web portal 404s on URLs with a trailing slash

0
All issues

Description

Web portal routes 404 when the URL has a trailing slash. The same path without the slash works.

Steps to reproduce

  1. Open https://trackslash.com/badbundle/projects/ (trailing slash).
  2. Open https://trackslash.com/badbundle/projects (no trailing slash).

Expected

Both resolve to the same page. The trailing-slash form should redirect to the canonical no-slash URL.

Actual

URL Status
/badbundle/projects/ 404
/badbundle/projects 200

Notes

Router() in internal/server/server.go:118 builds the chi router with no slash-handling middleware, so chi treats the two paths as distinct routes.

middleware.RedirectSlashes gives a canonical 301 to the no-slash form, which is the right behaviour for portal pages. Scope it to the web portal route group rather than mounting it globally: a 301 on a POST can cause clients to retry as GET, and the /mcp and JSON API routes should not have their paths rewritten underneath them.

Cover both the redirect and the untouched API/MCP behaviour with handler tests.

Sub-issues

0

Linked issues

0

GitHub

0

No branches or pull requests linked.

Comments

0
No comments.