From c8a99d2f8140a21b58561c87eaea331fa41f003c Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 11 Aug 2016 16:54:17 -0600 Subject: [PATCH] Don't use X-Forwarded-For for {remote} placeholder (closes #1025) --- caddyhttp/httpserver/replacer.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/caddyhttp/httpserver/replacer.go b/caddyhttp/httpserver/replacer.go index 407c43dfb..508439625 100644 --- a/caddyhttp/httpserver/replacer.go +++ b/caddyhttp/httpserver/replacer.go @@ -84,9 +84,6 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla "{fragment}": func() string { return r.URL.Fragment }, "{proto}": func() string { return r.Proto }, "{remote}": func() string { - if fwdFor := r.Header.Get("X-Forwarded-For"); fwdFor != "" { - return fwdFor - } host, _, err := net.SplitHostPort(r.RemoteAddr) if err != nil { return r.RemoteAddr