8000 fix(server): return 404 for a malformed API path instead of a redirect by opsmon · Pull Request #254 · aenix-io/aeman · GitHub
[go: up one dir, main page]

Skip to content

fix(server): return 404 for a malformed API path instead of a redirect - #254

Merged
kvaps merged 1 commit into
aenix-io:mainfrom
opsmon:239
Nov 2, 2026
Merged

kvaps merged 1 commit into
aenix-io:mainfrom
opsmon:239

Conversation

@opsmon
@opsmon opsmon commented Sep 25, 2026
Copy link
Copy Markdown
Contributor

Summary

  • intercept API paths containing doubled slashes, . or .. segments before they reach http.ServeMux
  • return the existing 404 unknownRoute problem response instead of a 307 HTML redirect
  • apply the same behavior to /api/v1, /api/config, and /api/healthz
  • add regression coverage verifying the JSON response and absence of a Location header

Testing

  • go test ./...
  • go test -race ./...

Closes #239

@kvaps kvaps changed the title issue: #239 fix(server): return 404 for a malformed API path instead of a redirect Nov 2, 2026
@kvaps
kvaps merged commit eaaef5e into aenix-io:main Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A path needing cleaning is answered by the mux before any /api/v1 handler sees it

2 participants

0