mirror of
https://github.com/caddyserver/caddy.git
synced 2026-11-19 14:29:41 +00:00
* 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
|
||
|---|---|---|
| .. | ||
| caddyfile_adapt | ||
| testdata | ||
| acme_test.go | ||
| acmeserver_test.go | ||
| autohttps_test.go | ||
| caddyfile_adapt_test.go | ||
| caddyfile_test.go | ||
| ech_test.go | ||
| fastcgi_chunked_test.go | ||
| forwardauth_test.go | ||
| h2listener_test.go | ||
| handler_test.go | ||
| intercept_test.go | ||
| leafcertloaders_test.go | ||
| listener_test.go | ||
| logging_test.go | ||
| map_test.go | ||
| mockdns_test.go | ||
| panic_test.go | ||
| phpfastcgi_test.go | ||
| pki_test.go | ||
| proxyprotocol_test.go | ||
| request_body_timeout_test.go | ||
| reverseproxy_test.go | ||
| rewrite_security_test.go | ||
| sni_test.go | ||
| stream_test.go | ||
| try_files_test.go | ||