|
8 | 8 | * - Reject case variations of header values (case-sensitive) |
9 | 9 | * - Handle whitespace trimming per HTTP spec |
10 | 10 | * - Validate Base64-encoded custom header values |
11 | | - * - Return 400 Bad Request with error code -32001 (HeaderMismatch) |
| 11 | + * - Return 400 Bad Request with error code -32020 (HeaderMismatch) |
12 | 12 | * |
13 | 13 | * This is a ClientScenario (connects to a server under test and validates |
14 | 14 | * its behavior). |
@@ -66,8 +66,8 @@ const REJECT_STATUS_CHECK_ID = 'sep-2243-server-reject-invalid-headers'; |
66 | 66 | const REJECT_ERROR_CODE_CHECK_ID = 'sep-2243-server-reject-error-code'; |
67 | 67 |
|
68 | 68 | // CUSTOM-header (Mcp-Param-*) rejections map to the param-validation |
69 | | -// requirements instead. The -32001 error-code half of every custom-header |
70 | | -// rejection is the "reject with 400 + JSON-RPC error code -32001 if any |
| 69 | +// requirements instead. The -32020 error-code half of every custom-header |
| 70 | +// rejection is the "reject with 400 + JSON-RPC error code -32020 if any |
71 | 71 | // validation fails" requirement. |
72 | 72 | const PARAM_REJECT_ERROR_CODE_CHECK_ID = |
73 | 73 | 'sep-2243-server-reject-param-mismatch'; |
@@ -148,8 +148,8 @@ async function sendRawRequest( |
148 | 148 |
|
149 | 149 | /** |
150 | 150 | * Builds two checks for a rejection case: one for the HTTP 400 status, one for |
151 | | - * the -32001 JSON-RPC error code. Per SEP-2243 §Server Validation, 400 is MUST |
152 | | - * but -32001 is SHOULD for *standard* headers (and MUST for *custom* headers, |
| 151 | + * the -32020 JSON-RPC error code. Per SEP-2243 §Server Validation, 400 is MUST |
| 152 | + * but -32020 is SHOULD for *standard* headers (and MUST for *custom* headers, |
153 | 153 | * §Server Behavior for Custom Headers) — so a server returning 400 with a |
154 | 154 | * different error code is compliant for standard headers and must not FAIL. |
155 | 155 | * |
@@ -196,7 +196,7 @@ function createRejectionChecks( |
196 | 196 | { |
197 | 197 | id: errorCodeId, |
198 | 198 | name: `${name}ErrorCode`, |
199 | | - description: `${description} — uses JSON-RPC error code -32001 (HeaderMismatch)`, |
| 199 | + description: `${description} — uses JSON-RPC error code -32020 (HeaderMismatch)`, |
200 | 200 | status: codeOk ? 'SUCCESS' : opts.errorCodeSeverity, |
201 | 201 | timestamp: ts, |
202 | 202 | errorMessage: codeOk |
@@ -265,7 +265,7 @@ export class HttpHeaderValidationScenario implements ClientScenario { |
265 | 265 | - Server MUST reject case-mismatched header values (method values are case-sensitive) |
266 | 266 | - Server MUST accept extra whitespace around header values (per HTTP spec) |
267 | 267 | - Server MUST return HTTP 400 Bad Request for validation failures |
268 | | -- Server MUST return JSON-RPC error with code -32001 (HeaderMismatch)`; |
| 268 | +- Server MUST return JSON-RPC error with code -32020 (HeaderMismatch)`; |
269 | 269 |
|
270 | 270 | async run(ctx: RunContext): Promise<ConformanceCheck[]> { |
271 | 271 | const { serverUrl } = ctx; |
@@ -507,7 +507,7 @@ export class HttpHeaderValidationScenario implements ClientScenario { |
507 | 507 | ...extraHeaders |
508 | 508 | }); |
509 | 509 | if (expectation === 'reject') { |
510 | | - // Standard-header rejection: 400 is MUST, -32001 is SHOULD. All |
| 510 | + // Standard-header rejection: 400 is MUST, -32020 is SHOULD. All |
511 | 511 | // standard-header rejection cases collapse onto the coarse requirement |
512 | 512 | // ids; checkId/checkName still distinguish the case via name/details. |
513 | 513 | checks.push( |
@@ -926,10 +926,10 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario |
926 | 926 | ) |
927 | 927 | ); |
928 | 928 | } else { |
929 | | - // Custom-header rejection: both 400 and -32001 are MUST per |
| 929 | + // Custom-header rejection: both 400 and -32020 are MUST per |
930 | 930 | // §Server Behavior for Custom Headers. The status half maps to the |
931 | 931 | // param-validation requirement this case exercises (checkId); the |
932 | | - // error-code half is the "400 + -32001 if any validation fails" |
| 932 | + // error-code half is the "400 + -32020 if any validation fails" |
933 | 933 | // requirement. |
934 | 934 | checks.push( |
935 | 935 | ...createRejectionChecks( |
@@ -992,7 +992,7 @@ export class HttpCustomHeaderServerValidationScenario implements ClientScenario |
992 | 992 | } |
993 | 993 | ); |
994 | 994 |
|
995 | | - // Custom-header rejection: both 400 and -32001 are MUST. A header |
| 995 | + // Custom-header rejection: both 400 and -32020 are MUST. A header |
996 | 996 | // omitted while the body carries a value is a header/body mismatch, so |
997 | 997 | // the status half maps to the validate-param-match requirement. |
998 | 998 | checks.push( |
|
0 commit comments