Commit cf87495
committed
fix(streamable-http): also reject PUT/PATCH/OPTIONS/HEAD without session-id
cubic-dev-ai flagged that the previous fix only short-circuited GET and
DELETE — the other non-POST methods still entered the "new session"
branch, allocated a transport, and spawned run_server before the
transport-layer 405 was returned. Same leak, different method.
This commit extends the check to every non-POST method. GET/DELETE
remain 400 "Missing session ID" (protocol-valid when a session exists,
so the caller may have simply forgotten the header). Everything else
becomes 405 "Method Not Allowed" at the manager layer — matching the
old transport-layer 405 exactly, minus the leaked session and task.
Also applies the repository's ruff format to the test module, which
the pre-commit hook flagged on CI, and switches the regression test's
assertions to use the parametrized ``expected_status`` /
``expected_message_substring`` values so the new PUT/PATCH/OPTIONS/HEAD
rows can piggy-back on the same test body.1 parent dbadb12 commit cf87495
2 files changed
Lines changed: 68 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
292 | 292 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
311 | 323 | | |
312 | 324 | | |
313 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
399 | 416 | | |
400 | 417 | | |
401 | 418 | | |
| |||
445 | 462 | | |
446 | 463 | | |
447 | 464 | | |
448 | | - | |
| 465 | + | |
449 | 466 | | |
450 | 467 | | |
451 | 468 | | |
452 | 469 | | |
453 | | - | |
| 470 | + | |
454 | 471 | | |
455 | 472 | | |
456 | 473 | | |
| |||
466 | 483 | | |
467 | 484 | | |
468 | 485 | | |
469 | | - | |
470 | | - | |
471 | | - | |
| 486 | + | |
472 | 487 | | |
473 | 488 | | |
474 | 489 | | |
| |||
0 commit comments