caddy/caddytest/integration
Kévin Dunglas b53025bf19
requestbody: enforce max_size early using Content-Length (#8337)
* requestbody: reject oversized Content-Length before the next handler

When max_size is set and the request declares a Content-Length above it, respond 413 right away instead of letting the next handler start and fail mid-read. Bodies of unknown length are still limited by MaxBytesReader. Both paths return the same error, so handle_errors sees no difference.

* caddytest: send unknown-length bodies in max_size placeholder tests

request_body now answers 413 for a declared Content-Length over max_size before the placeholder reads the body, so these tests no longer covered the read path and the direct respond one failed.

* requestbody: keep the body limited for error routes

Error routes get the same request, so wrap the body before the early 413 to stop them from reading past max_size.

(cherry picked from commit 6cdffe9502)
2026-11-03 18:25:44 -05:00
..
caddyfile_adapt httpcaddyfile: preserve automation policy precedence when merging (#8287) 2026-11-03 00:53:50 -05:00
testdata fix(caddyfile): {block} in snippet (#7558) 2026-04-15 02:58:53 -04:00
acme_test.go logging: Ensure `slog` error level logs don't print stack traces (#7512) 2026-03-03 14:44:42 -07:00
acmeserver_test.go
…
autohttps_test.go caddyhttp: prefer port 443 in auto-HTTPS and add tests (#7666) 2026-04-23 17:29:03 +10:00
caddyfile_adapt_test.go
…
caddyfile_test.go headers: evaluate conditional defaults independently (#8217) 2026-11-03 00:53:18 -05:00
ech_test.go caddytls: Send ECH retry configs when rejecting ECH (#8142) 2026-11-03 00:53:03 -05:00
fastcgi_chunked_test.go fastcgi: explain the 411 a body without a length gets (#7956) 2026-09-23 09:31:54 -06:00
forwardauth_test.go Merge commit from fork 2026-08-11 08:00:15 -06:00
h2listener_test.go
…
handler_test.go requestbody: enforce max_size early using Content-Length (#8337) 2026-11-03 18:25:44 -05:00
intercept_test.go intercept: fix replace_status being silently dropped (#7810) 2026-06-12 15:50:58 -06:00
leafcertloaders_test.go
…
listener_test.go
…
logging_test.go caddyhttp: ignore case when matching hosts in logger_names (#8176) 2026-11-03 00:53:04 -05:00
map_test.go map: reject malformed destination placeholders (#8074) 2026-09-28 22:19:51 +10:00
mockdns_test.go
…
panic_test.go caddyhttp: log recovered handler panics at ERROR level (#7924) 2026-08-10 02:18:17 -04:00
phpfastcgi_test.go fastcgi: keep the php_fastcgi directory redirect on the same origin (#8285) 2026-11-03 00:53:19 -05:00
pki_test.go
…
proxyprotocol_test.go proxyproto: Generated test coverage (#7540) 2026-03-03 15:08:09 -07:00
request_body_timeout_test.go caddyhttp: preserve expired request-body read deadlines (#8178) 2026-11-03 00:53:04 -05:00
reverseproxy_test.go reverseproxy: Don't drop read errors with unlimited buffers (#8207) 2026-11-03 00:53:18 -05:00
rewrite_security_test.go Merge commit from fork 2026-09-14 12:50:44 -06:00
sni_test.go
…
stream_test.go chore: clean up wording and typo fixes (#7745) 2026-05-20 16:36:30 +10:00
try_files_test.go caddyhttp: skip matchers for satisfied route groups (#8189) 2026-11-03 00:53:04 -05:00