php-sdk/tests/Unit/Server/Stateless
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christopher Hertel 7e38c94954
[Server] Enforce x-mcp-header where a request uses it (SEP-2243) (#453)
* [Server] Enforce x-mcp-header where a request uses it

Only top-level properties were inspected, so an annotation on a nested
property was silently unenforced - the header could say anything. The walk
now follows a chain of properties keys to any depth and reads the argument
at that exact path.

Integer values compare numerically, so a client writing 42.0 for a body
value of 42 is no longer rejected.

* [Server] Stop comparing numeric-looking strings as numbers

is_numeric() and loose == both treat a string like "042" as equal to
"42", so a string argument could pass header validation against a
header that doesn't match it exactly. Gate the numeric comparison on
the argument's actual type and a decimal-only header instead.
2026-08-19 00:42:40 +02:00
..
InputContextTest.php [Server] Complete the multi round-trip request surface (SEP-2322) (#449) 2026-08-18 23:41:00 +02:00
RequestStateCodecTest.php [Server][Tests] Complete the multi round-trip request flow (SEP-2322) (#446) 2026-08-18 22:45:35 +02:00
StandardHeaderValidatorTest.php [Server] Enforce x-mcp-header where a request uses it (SEP-2243) (#453) 2026-08-19 00:42:40 +02:00
StatelessProtocolTest.php [Server] Carry trace context through a request (#452) 2026-08-19 00:20:32 +02:00