README and SPEC say a client too slow to send its request line and headers may get 400 (closes #138)
check / check (push) Canceled after 0s

A client too slow to send its request line and headers within
SWWAF_CLIENT_REQUEST_TIMEOUT gets either no answer or, depending on how
much of them had arrived, 400 Bad Request from Go's server; either way
its connection is closed, nothing reaches the app, and no request log
line is written. The README's "Request log" and SPEC's size and time
limits said such a client always gets no answer. Both documents'
summaries of answers gave 408 for any slow client, when it is only for
a slow body.

Model: opus-5-5
This commit is contained in:
2026-10-20 11:55:29 +00:00
parent 60c49a6740
commit 2387bd4f3a
2 changed files with 21 additions and 16 deletions
+10 -8
View File
@@ -437,10 +437,10 @@ The settings, by group:
the app sends it and the client receives it.
- When a limit is passed before the response has started, `smallwebwaf`
answers itself: `413` for a request body that is too large, `408` for a
client that is too slow, `502` for a response that is too large, `504` for
an app that is too slow. A request that announces a body larger than its
limit is refused before anything reaches the app. Once the response has
started it can only be cut off, and the connection is closed.
client too slow to send its body, `502` for a response that is too large,
`504` for an app that is too slow. A request that announces a body larger
than its limit is refused before anything reaches the app. Once the
response has started it can only be cut off, and the connection is closed.
- Since a request body streams through, each side can hold up the other: a
slow client slows the send to the app, and an app slow to take the body
slows the client's send. So while a request body is still on its way, a
@@ -450,10 +450,12 @@ The settings, by group:
waiting for the app to take what it had.
- Go's HTTP server, on which `smallwebwaf` is built, reads a request's line
and headers before `smallwebwaf` sees the request. A client that takes
longer than `SWWAF_CLIENT_REQUEST_TIMEOUT` to send them gets no answer:
the server closes its connection. Headers over
`SWWAF_CLIENT_REQUEST_HEADER_MAX_BYTES` are answered `431` by the server
itself. Neither request gets a line in the request log.
longer than `SWWAF_CLIENT_REQUEST_TIMEOUT` to send them gets either no
answer or, depending on how much of them had arrived, `400 Bad Request`
from the server; either way the server closes its connection and nothing
reaches the app. Headers over `SWWAF_CLIENT_REQUEST_HEADER_MAX_BYTES` are
answered `431` by the server itself. Neither request gets a line in the
request log.
- A WebSocket connection leaves these limits behind once it is upgraded: it
stays open until either side closes it.
- Lookup of AS number and country (R7). On by default through GeoJS, which needs