caddy/modules/caddyhttp/reverseproxy
Matthew Holt 7a58576d34 reverseproxy: keep empty unknown-length request bodies retryable
The consumed-stream retry guard treated any read of a streaming request
body as consumption. Go's transport probes unknown-length bodies of GET,
HEAD, and similar requests before sending them, and HTTP/3 reports
bodyless GET and HEAD requests with an unknown length, so every such
request lost its retries once an upstream connection was established.

A first read that returns io.EOF without data no longer counts as
consumption. Later attempts send http.NoBody, while bodies that yield
data, fail, or are interrupted mid-read remain non-retryable.

Follow-up to de1bcf6d-457c-4348-9d4e-5eeb41cc120b.

Code written by GitHub Copilot (GPT-6.1 Sol, Claude Opus 5.5); reviewed by mholt.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-11 11:06:41 -07:00
..
fastcgi fastcgi: rewrite to index.php only if it exists (#8372) 2026-11-08 22:04:20 +00:00
forwardauth
active_health_test.go Revert #8223 2026-10-17 15:28:01 +08:00
addresses.go
addresses_test.go
admin.go
admin_test.go
ascii.go
ascii_test.go
buffering_test.go reverseproxy: fix buffered body ownership and unsafe retries 2026-11-11 11:06:41 -07:00
caddyfile.go reverseproxy: Optionally detach stream (websockets) from config lifecycle (#7649) 2026-10-04 07:45:10 -04:00
client_disconnect_test.go reverseproxy: log HTTP/3 client cancellations at debug level (#8135) 2026-10-04 12:48:06 +00:00
command.go
copyresponse.go reverseproxy: strip hop-by-hop headers when copying response headers (#8270) 2026-10-26 09:21:29 +00:00
copyresponse_test.go reverseproxy: strip hop-by-hop headers when copying response headers (#8270) 2026-10-26 09:21:29 +00:00
dynamic_upstreams_test.go
extended_connect_test.go reverseproxy: simplify WebSocket header handling (#8365) 2026-11-05 04:45:23 -05:00
handleresponse_test.go reverseproxy: close upstream body when handle_response status is invalid (#8318) 2026-11-03 06:58:00 +00:00
headers_test.go reverseproxy: strip hop-by-hop headers from interim responses (#8256) 2026-10-20 17:11:30 +10:00
healthchecks.go Revert #8223 2026-10-17 15:28:01 +08:00
hopheaders_test.go reverseproxy: Optionally detach stream (websockets) from config lifecycle (#7649) 2026-10-04 07:45:10 -04:00
hosts.go
httptransport.go caddytls: validate curve and protocol names, compare protocol IDs (#8266) 2026-10-26 20:14:59 +00:00
httptransport_test.go caddytls: validate curve and protocol names, compare protocol IDs (#8266) 2026-10-26 20:14:59 +00:00
incremental_test.go
metrics.go reverseproxy: Optionally detach stream (websockets) from config lifecycle (#7649) 2026-10-04 07:45:10 -04:00
metrics_test.go reverseproxy: Optionally detach stream (websockets) from config lifecycle (#7649) 2026-10-04 07:45:10 -04:00
passive_health_test.go caddyhttp, reverseproxy: experimental WebTransport passthrough (#7669) 2026-10-12 23:24:10 -04:00
prepare_request_bench_test.go
request_target_test.go caddyhttp: reject opaque targets before routing and proxying 2026-11-11 11:06:41 -07:00
request_trailers_test.go reverseproxy: align trailer tests with consumed-stream retry safety 2026-11-11 11:06:41 -07:00
retries_test.go reverseproxy: keep empty unknown-length request bodies retryable 2026-11-11 11:06:41 -07:00
reverseproxy.go reverseproxy: keep empty unknown-length request bodies retryable 2026-11-11 11:06:41 -07:00
selectionpolicies.go reverseproxy: preserve weights among available upstreams (#8380) 2026-11-08 11:32:09 +00:00
selectionpolicies_bench_test.go caddyhttp: presize buffers in hot paths to reduce allocations (#7842) 2026-11-04 20:26:53 +00:00
selectionpolicies_test.go reverseproxy: preserve weights among available upstreams (#8380) 2026-11-08 11:32:09 +00:00
streaming.go reverseproxy: send every close message before closing tunnel connections (#8371) 2026-11-08 11:05:28 +00:00
streaming_test.go reverseproxy: send every close message before closing tunnel connections (#8371) 2026-11-08 11:05:28 +00:00
tracing_test.go reverseproxy: emit OpenTelemetry client spans (#8177) 2026-10-23 16:28:55 +10:00
upstreams.go reverseproxy: reduce lock contention in dynamic SRV and A upstreams (#7949) 2026-11-03 08:37:50 +00:00
upstreams_bench_test.go
upstreams_test.go reverseproxy: make the shared DNS discovery cache resolver-aware (#8252) 2026-10-31 17:23:41 -04:00
webtransport_pump.go caddyhttp, reverseproxy: experimental WebTransport passthrough (#7669) 2026-10-12 23:24:10 -04:00
webtransport_pump_test.go caddyhttp, reverseproxy: experimental WebTransport passthrough (#7669) 2026-10-12 23:24:10 -04:00
webtransport_transport.go caddyhttp, reverseproxy: experimental WebTransport passthrough (#7669) 2026-10-12 23:24:10 -04:00
webtransport_transport_test.go caddyhttp, reverseproxy: experimental WebTransport passthrough (#7669) 2026-10-12 23:24:10 -04:00