Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/docs/malformed-input/post-cl-huge-no-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ weight: 26
| **Test ID** | `MAL-POST-CL-HUGE-NO-BODY` |
| **Category** | Malformed Input |
| **RFC** | [RFC 9112 Section 6.2](https://www.rfc-editor.org/rfc/rfc9112#section-6.2) |
| **Expected** | `400`/close/timeout |
| **Expected** | `400`/`413`/close/timeout |

## What it sends

Expand All @@ -34,7 +34,7 @@ The value `999999999` (~1GB) is a syntactically valid Content-Length, but no bod

> "The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error." — RFC 9110 Section 15.5.1

A server may reject the request with 400 if the declared body size exceeds its limits, close the connection, or timeout waiting for body data that never arrives.
A server may reject the request with 400 or 413 if the declared body size exceeds its limits, close the connection, or timeout waiting for body data that never arrives.

## Why it matters

Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/smuggling/expect-100-cl.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ weight: 33
| **Category** | Smuggling |
| **RFC** | [RFC 9110 §10.1.1](https://www.rfc-editor.org/rfc/rfc9110#section-10.1.1) |
| **Requirement** | Unscored |
| **Expected** | `400` or `2xx` |
| **Expected** | `100`, `400` or `2xx` |

## What it sends

Expand Down Expand Up @@ -39,7 +39,7 @@ The body is sent immediately without waiting for a `100 Continue` response.
The RFC requires the server to send either a `100 Continue` interim response or a final status code when it receives `Expect: 100-continue`. However, the client in this test sends the body immediately without waiting. The server may still process the body normally (responding `2xx`), or it may reject the request. Both behaviors are implementation-dependent and valid.

**Pass:** Server rejects with `400` (strict, safe).
**Warn:** Server accepts and responds `2xx` (processes body despite Expect header).
**Warn:** Server responds `100 Continue` (valid — sent interim response despite already having the body) or `2xx` (processes body despite Expect header).

## Why it matters

Expand Down
6 changes: 3 additions & 3 deletions src/Http11Probe/TestCases/Suites/MalformedInputSuite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,12 @@ public static IEnumerable<TestCase> GetTestCases()
$"POST / HTTP/1.1\r\nHost: {ctx.HostHeader}\r\nContent-Length: 999999999\r\n\r\n"),
Expected = new ExpectedBehavior
{
Description = "400/close/timeout",
Description = "400/413/close/timeout",
CustomValidator = (response, state) =>
{
// If server sent a response, only 400 is acceptable
// If server sent a response, 400 or 413 are acceptable
if (response is not null)
return response.StatusCode == 400 ? TestVerdict.Pass : TestVerdict.Fail;
return response.StatusCode is 400 or 413 ? TestVerdict.Pass : TestVerdict.Fail;
// No response: close or timeout means server correctly waited
if (state is ConnectionState.TimedOut or ConnectionState.ClosedByServer)
return TestVerdict.Pass;
Expand Down
4 changes: 3 additions & 1 deletion src/Http11Probe/TestCases/Suites/SmugglingSuite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,13 +1082,15 @@ public static IEnumerable<TestCase> GetTestCases()
$"POST / HTTP/1.1\r\nHost: {ctx.HostHeader}\r\nContent-Length: 5\r\nExpect: 100-continue\r\n\r\nhello"),
Expected = new ExpectedBehavior
{
Description = "400 or 2xx",
Description = "100, 400 or 2xx",
CustomValidator = (response, state) =>
{
if (response is null)
return state == ConnectionState.ClosedByServer ? TestVerdict.Pass : TestVerdict.Fail;
if (response.StatusCode == 400)
return TestVerdict.Pass;
if (response.StatusCode == 100)
return TestVerdict.Warn;
if (response.StatusCode is >= 200 and < 300)
return TestVerdict.Warn;
return TestVerdict.Fail;
Expand Down
Loading