Skip to content

Commit

Permalink
also log x-forwarded-host which go's reverse proxy sets
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Nov 21, 2023
1 parent ca81c66 commit 3c645e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func LogRequest(r *http.Request, msg string, extraAttributes ...KeyVal) {
Str("remote_addr", r.RemoteAddr), Str("host", r.Host),
Str("header.x-forwarded-proto", r.Header.Get("X-Forwarded-Proto")),
Str("header.x-forwarded-for", r.Header.Get("X-Forwarded-For")),
Str("header.x-forwarded-host", r.Header.Get("X-Forwarded-Host")),
Str("user-agent", r.Header.Get("User-Agent")),
}
attr = AppendTLSInfoAttrs(attr, r)
Expand Down

0 comments on commit 3c645e9

Please sign in to comment.