Test rproxy's 32 KiB header limit at its edge (closes #415) #419

Merged
clawbot merged 1 commits from issue-415-header-limit-test into next 2026-11-19 10:20:08 +01:00
Collaborator

Closes #415.

rproxy already had the limit as a constant (requestHeaderMaxBytes in internal/rproxy/rproxy.go), with no setting to remove. This PR adds the two tests the issue asks for:

  • a request line and headers of exactly 32 KiB reach the app;
  • one byte more is answered 431, the connection is closed, and waf is not asked.

The 32 KiB counts the request line, every header line and the blank line that ends them.

The comparison with sneak's model is on the issue: #415 (comment)

Judgement call: "drops the connection" is read as Go's server sending 431 and then closing, which it does before rproxy's handler runs. Closing with no answer at all would need a wrapper around each connection. Reversing this costs that wrapper and a change to the over-limit test.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/415. `rproxy` already had the limit as a constant (`requestHeaderMaxBytes` in `internal/rproxy/rproxy.go`), with no setting to remove. This PR adds the two tests the issue asks for: - a request line and headers of exactly 32 KiB reach the app; - one byte more is answered `431`, the connection is closed, and `waf` is not asked. The 32 KiB counts the request line, every header line and the blank line that ends them. The comparison with sneak's model is on the issue: https://git.eeqj.de/sneak/smallwebwaf/issues/415#issuecomment-183111 Judgement call: "drops the connection" is read as Go's server sending `431` and then closing, which it does before `rproxy`'s handler runs. Closing with no answer at all would need a wrapper around each connection. Reversing this costs that wrapper and a change to the over-limit test. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 09:21:44 +01:00
clawbot added 1 commit 2026-11-19 09:21:44 +01:00
The limit was already a constant with no setting. These tests pin it:
a request line and headers of exactly 32 KiB reach the app, and one
byte more is answered 431 with the connection closed and waf not asked.

Model: opus-5-5
clawbot self-assigned this 2026-11-19 09:21:48 +01:00
Author
Collaborator

Verdict: PASS
Head: 342dfe4f97

The two tests pin rproxy's fixed 32 KiB limit on the request line and headers at its exact edge, and the comparison with sneak's model is posted on #415, which meets the definition of done.

Judgement call accepted: Go's 431 followed by a close counts as dropping the connection.

Model: opus-5-5

Verdict: PASS Head: 342dfe4f97e136c601cd6a5215edb7caae46c22d The two tests pin `rproxy`'s fixed 32 KiB limit on the request line and headers at its exact edge, and the comparison with sneak's model is posted on https://git.eeqj.de/sneak/smallwebwaf/issues/415, which meets the definition of done. Judgement call accepted: Go's `431` followed by a close counts as dropping the connection. Model: opus-5-5
clawbot merged commit 48edab5dad into next 2026-11-19 10:20:08 +01:00
Sign in to join this conversation.