diff --git a/docs/content/docs/malformed-input/long-method.md b/docs/content/docs/malformed-input/long-method.md index 9fdf36e..72f93e1 100644 --- a/docs/content/docs/malformed-input/long-method.md +++ b/docs/content/docs/malformed-input/long-method.md @@ -8,7 +8,7 @@ weight: 5 |---|---| | **Test ID** | `MAL-LONG-METHOD` | | **Category** | Malformed Input | -| **Expected** | `400` or close | +| **Expected** | `400`/`501` or close | ## What it sends diff --git a/src/Http11Probe/TestCases/Suites/MalformedInputSuite.cs b/src/Http11Probe/TestCases/Suites/MalformedInputSuite.cs index 7a05595..04b34da 100644 --- a/src/Http11Probe/TestCases/Suites/MalformedInputSuite.cs +++ b/src/Http11Probe/TestCases/Suites/MalformedInputSuite.cs @@ -231,12 +231,13 @@ public static IEnumerable GetTestCases() }, Expected = new ExpectedBehavior { - Description = "400 or close", + Description = "400, 501 or close", CustomValidator = (response, state) => { if (response is null) return state == ConnectionState.ClosedByServer ? TestVerdict.Pass : TestVerdict.Fail; - return response.StatusCode == 400 + // RFC 9112 ยง3: a method longer than any the server implements SHOULD get 501. + return response.StatusCode is 400 or 501 ? TestVerdict.Pass : TestVerdict.Fail; }