Commit ac0dd303 authored by Matt Holt's avatar Matt Holt Committed by GitHub

Merge branch 'master' into log-request-body

parents 676202a3 c8a99d2f
...@@ -87,9 +87,6 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla ...@@ -87,9 +87,6 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla
"{fragment}": func() string { return r.URL.Fragment }, "{fragment}": func() string { return r.URL.Fragment },
"{proto}": func() string { return r.Proto }, "{proto}": func() string { return r.Proto },
"{remote}": func() string { "{remote}": func() string {
if fwdFor := r.Header.Get("X-Forwarded-For"); fwdFor != "" {
return fwdFor
}
host, _, err := net.SplitHostPort(r.RemoteAddr) host, _, err := net.SplitHostPort(r.RemoteAddr)
if err != nil { if err != nil {
return r.RemoteAddr return r.RemoteAddr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment