Commit be9c118
committed
fix(streamable-http): mirror the transport's 405 shape (Allow header + body)
cubic-dev-ai flagged that the manager's manager-layer 405 for
PUT/PATCH/OPTIONS/HEAD without a session-id was missing the RFC 7231
``Allow`` header and diverged from the transport's response body. That
breaks clients / middleware that rely on the standard 405 metadata to
learn which methods are allowed on the resource.
The manager now mirrors ``StreamableHTTPServerTransport._handle_unsupported_request``
exactly:
* Body: JSON-RPC error with message ``"Method Not Allowed"`` (previously
``"Method Not Allowed (PUT)"`` — a divergence).
* Headers: ``Content-Type: application/json`` + ``Allow: GET, POST, DELETE``.
The 400 branch for GET/DELETE is unchanged.
The parametrized regression test now also asserts the ``Allow`` header
value for every 405 row (PUT/PATCH/OPTIONS/HEAD).1 parent cf87495 commit be9c118
2 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
301 | 307 | | |
302 | 308 | | |
303 | 309 | | |
| |||
313 | 319 | | |
314 | 320 | | |
315 | 321 | | |
316 | | - | |
| 322 | + | |
317 | 323 | | |
318 | 324 | | |
319 | 325 | | |
320 | 326 | | |
321 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
322 | 331 | | |
323 | 332 | | |
324 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
472 | 485 | | |
473 | 486 | | |
474 | 487 | | |
| |||
0 commit comments