mirror of
https://github.com/caddyserver/caddy.git
synced 2026-10-31 18:55:43 +00:00
When a request arrives via a Unix domain socket (RemoteAddr == "@"), net.SplitHostPort fails, causing addForwardedHeaders to strip all X-Forwarded-* headers even when the connection is trusted via trusted_proxies_unix. Handle Unix socket connections before parsing RemoteAddr: if untrusted, strip headers for security; if trusted, let clientIP remain empty (no peer IP for a Unix socket hop) and fall through to the shared header logic, preserving the existing XFF chain without appending a spurious entry. Amp-Thread-ID: https://ampcode.com/threads/T-019c4225-a0ad-7283-ac56-e2c01eae1103 Co-authored-by: Amp <amp@ampcode.com> |
||
|---|---|---|
| .. | ||
| fastcgi | ||
| forwardauth | ||
| addresses.go | ||
| addresses_test.go | ||
| admin.go | ||
| ascii.go | ||
| ascii_test.go | ||
| buffering_test.go | ||
| caddyfile.go | ||
| command.go | ||
| copyresponse.go | ||
| headers_test.go | ||
| healthchecks.go | ||
| hosts.go | ||
| httptransport.go | ||
| httptransport_test.go | ||
| metrics.go | ||
| reverseproxy.go | ||
| selectionpolicies.go | ||
| selectionpolicies_test.go | ||
| streaming.go | ||
| streaming_test.go | ||
| upstreams.go | ||
| upstreams_test.go | ||