mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Add server instance to the context in ServerTLS and ServerHTTPS (#2840)
* Add server instance to the context in ServerTLS and ServerHTTPS The problem with the current code is that there's no way to get the server instance inside a plugin. Because of that "metrics" plugin sets empty "server" label for requests served over TLS or HTTPS. * use s.Server instead of s * Added server to the context of grpc requests
This commit is contained in:
committed by
Miek Gieben
parent
c5f49257be
commit
aebbc4883d
@@ -129,7 +129,8 @@ func (s *ServergRPC) Query(ctx context.Context, in *pb.DnsPacket) (*pb.DnsPacket
|
||||
|
||||
w := &gRPCresponse{localAddr: s.listenAddr, remoteAddr: a, Msg: msg}
|
||||
|
||||
s.ServeDNS(ctx, w, msg)
|
||||
dnsCtx := context.WithValue(ctx, Key{}, s.Server)
|
||||
s.ServeDNS(dnsCtx, w, msg)
|
||||
|
||||
packed, err := w.Msg.Pack()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user