From 43fecdf60f94b0cc32a2295f4694ac1d194b39af Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 27 Apr 2023 20:43:01 +0700 Subject: [PATCH] all: log when client info included in the request --- cmd/ctrld/dns_proxy.go | 1 + doh.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/ctrld/dns_proxy.go b/cmd/ctrld/dns_proxy.go index ec2ce30..4a1685d 100644 --- a/cmd/ctrld/dns_proxy.go +++ b/cmd/ctrld/dns_proxy.go @@ -237,6 +237,7 @@ func (p *prog) proxy(ctx context.Context, upstreams []string, failoverRcodes []i if upstreamConfig.UpstreamSendClientInfo() { ci := router.GetClientInfoByMac(macFromMsg(msg)) if ci != nil { + ctrld.Log(ctx, mainLog.Debug(), "including client info with the request") ctx = context.WithValue(ctx, ctrld.ClientInfoCtxKey{}, ci) } } diff --git a/doh.go b/doh.go index 931b6a1..242f759 100644 --- a/doh.go +++ b/doh.go @@ -107,4 +107,5 @@ func addHeader(ctx context.Context, req *http.Request, sendClientInfo bool) { } } } + Log(ctx, ProxyLog.Debug().Interface("header", req.Header), "sending request header") }