Skip to content

Commit fcfcc35

Browse files
committed
chore: add changeset for hono-server 405 method-not-allowed fix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N9qJ2N2d1c9oCR5GPfBDaM
1 parent 61d5fca commit fcfcc35

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/plugin-hono-server': patch
3+
---
4+
5+
Return `405 Method Not Allowed` (with an accurate `Allow` header and a
6+
descriptive body) instead of an opaque `{"error":"Not found"}` 404 when a
7+
request hits a registered path under the wrong HTTP method.
8+
9+
Hono routes a method mismatch to the same `notFound` sink as a genuinely
10+
missing path, so a `POST` to a `PUT`-only route (e.g. the metadata save
11+
endpoint `PUT /api/v1/meta/:type/:name`) gave callers no hint that the path
12+
exists under another verb (#2684). The server now tracks every registered
13+
`(method, pattern)` pair and re-matches the request path in the `notFound`
14+
handler: matching another method yields a 405; matching nothing stays a 404.
15+
This is framework-wide — every registered endpoint benefits. Static/SPA
16+
catch-alls registered straight on the raw Hono app are not tracked and never
17+
produce a spurious 405.

0 commit comments

Comments
 (0)