all: log when client info included in the request

This commit is contained in:
Cuong Manh Le
2023-04-27 20:43:01 +07:00
committed by Cuong Manh Le
parent 31239684c7
commit 43fecdf60f
2 changed files with 2 additions and 0 deletions

View File

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

1
doh.go
View File

@@ -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")
}