fix: return header mismatch for missing protocol header (#1083)

Co-authored-by: mrcs64 <9069178+mrcs64@users.noreply.github.com>
This commit is contained in:
mrcs64 2026-07-29 22:02:49 +02:00 • committed by GitHub
commit f3c786706a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -473,9 +473,9 @@ fn validate_request_protocol_version_meta(
.get(HEADER_MCP_PROTOCOL_VERSION)
.and_then(|value| value.to_str().ok())
else {
return Err(invalid_request_jsonrpc_response(
return Err(header_mismatch_jsonrpc_response(
Some(request.id.clone()),
"Invalid Request: request _meta protocolVersion requires MCP-Protocol-Version header",
"request _meta protocolVersion requires MCP-Protocol-Version header",
));
};
if header_version != meta_version.as_str() {