Skip to content
Snippets Groups Projects
Commit ca262934 authored by gbe's avatar gbe
Browse files

Use request context when looking up PTR records for logging

parent ab5064c7
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ func Request(next http.Handler, logger log.Logger) http.Handler {
}
// Try to figure out a name for the remote. If there are multiple, we select the first.
names, err := net.LookupAddr(remote)
names, err := net.DefaultResolver.LookupAddr(r.Context(), remote)
if err != nil {
// Can't resolve name, but that's ok. There might not be a PTR record for the remote.
names = []string{"n/a"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment