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
+11 -8
View File
@@ -112,11 +112,11 @@ in `bin/state` unless `SWWAF_STATE_DIR` is set, and the default rule file of
log line (see `request_id` in "Request log" below).
- Enforces the timeouts and the size limits below. A limit passed before the
response has started gets `smallwebwaf`'s own answer: `408` for a client too
slow to send its request, `413` for a request body that is too large, `504`
for an app too slow to answer, and `502` for a response that is too large or
an app that cannot be reached. A request that announces a body over the limit
is refused before anything reaches the app. While a request body is still on
its way, a request timeout that runs out answers `408` if `smallwebwaf` was
slow to send its body, `413` for a request body that is too large, `504` for
an app too slow to answer, and `502` for a response that is too large or an
app that cannot be reached. A request that announces a body over the limit is
refused before anything reaches the app. While a request body is still on its
way, a request timeout that runs out answers `408` if `smallwebwaf` was
waiting for the client to send more, and `504` if it was waiting for the app
to take what it had. Once the response has started, a limit can only cut the
connection.
@@ -1042,9 +1042,12 @@ less severe than `SWWAF_LOG_LEVEL` are not written.
Go's HTTP server, on which `smallwebwaf` is built, reads a request's line and
headers before `smallwebwaf` sees the request, and some requests end there,
without a line in the log: headers over `SWWAF_CLIENT_REQUEST_HEADER_MAX_BYTES`,
which it answers `431`, headers slower than `SWWAF_CLIENT_REQUEST_TIMEOUT`,
whose connection it closes without an answer, and requests it cannot read at
all, which it answers itself, mostly with `400`.
which it answers `431`, and requests it cannot read at all, which it answers
itself, mostly with `400`. 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 the server;
either way the server closes its connection, nothing reaches the app, and no
line is written in the log.
### Sending the log to a syslog server