0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-13 22:51:08 -05:00

Don't use X-Forwarded-For for {remote} placeholder (closes #1025)

This commit is contained in:
Matthew Holt 2016-08-11 16:54:17 -06:00
parent 68be4a9161
commit c8a99d2f81
No known key found for this signature in database
GPG key ID: 0D97CC73664F4D03

View file

@ -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