class ValidateMcpHeaders

Methods

Response
handle(Request $request, Closure $next)

Handle an incoming request.

Response|null
unsupportedLegacyVersion(Request $request, mixed $id)

Validate the version on a request without modern metadata.

string|null
mismatch(Request $request, RequestHeader $header, mixed $expected, bool $required)

Describe a missing or mismatched protocol header.

Details

at line 25
Response handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request
Closure $next

Return Value

Response

at line 67
protected Response|null unsupportedLegacyVersion(Request $request, mixed $id)

Validate the version on a request without modern metadata.

Legacy clients never send the method and name headers, but they do send the negotiated protocol version after the handshake.

Parameters

Request $request
mixed $id

Return Value

Response|null

at line 103
protected string|null mismatch(Request $request, RequestHeader $header, mixed $expected, bool $required)

Describe a missing or mismatched protocol header.

Parameters

Request $request
RequestHeader $header
mixed $expected
bool $required

Return Value

string|null