Repository navigation
Commit c02cb2d
committed
refactor(server): read the SEP-2243 standard headers once; qualify the notification exemption
Addresses the three review nits on modelcontextprotocol#2590.
The entry built two InboundHttpRequest header objects from the same
request — one for classifyInboundRequest, one for the
standard-header rung — and the divergence between them is what let a
modern POST omitting MCP-Protocol-Version be served: the header was
read at the classifier site and not at the validation site. Both now
spread a single standardHeadersOf(request), so a header added to
InboundHttpRequest reaches both sites together.
The migration guide claimed the presence half applies to every modern
POST. Notification POSTs are exempt — validateStandardRequestHeaders
returns early for messageKind !== 'request', which the changeset
already said but the guide did not. Qualified, with the reason.
Converts the two remaining hand-built modern header sets in
protocol.test.ts to modernStandardHeaders(). The deliberate omission
in sep2243.test.ts stays: it asserts /Mcp-Method/ in the message and
so pins that the classifier's edge rung answers a mismatch before the
presence rung runs.1 parent 9543943 commit c02cb2d
3 files changed
Lines changed: 37 additions & 23 deletions
File tree
- docs/migration
- packages/server/src/server
- test/e2e/scenarios
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
646 | 652 | | |
647 | 653 | | |
648 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
406 | 407 | | |
407 | 408 | | |
408 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
409 | 429 | | |
410 | 430 | | |
411 | 431 | | |
| |||
467 | 487 | | |
468 | 488 | | |
469 | 489 | | |
470 | | - | |
471 | | - | |
472 | | - | |
| 490 | + | |
473 | 491 | | |
474 | 492 | | |
475 | 493 | | |
| |||
674 | 692 | | |
675 | 693 | | |
676 | 694 | | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
| 695 | + | |
686 | 696 | | |
687 | 697 | | |
688 | 698 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
1158 | 1158 | | |
1159 | 1159 | | |
1160 | 1160 | | |
1161 | | - | |
1162 | | - | |
| 1161 | + | |
1163 | 1162 | | |
1164 | 1163 | | |
1165 | 1164 | | |
| |||
1184 | 1183 | | |
1185 | 1184 | | |
1186 | 1185 | | |
1187 | | - | |
1188 | | - | |
| 1186 | + | |
1189 | 1187 | | |
1190 | 1188 | | |
1191 | 1189 | | |
| |||
0 commit comments