Pull request: all: imp cyclo in new code
Updates #2646, Squashed commit of the following: commit af6a6fa2b7229bc0f1c7c9083b0391a6bec7ae70 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon May 31 20:00:36 2021 +0300 all: imp code, docs commit 1cd4781b13e635a9e1bccb758104c1b76c78d34e Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon May 31 18:51:23 2021 +0300 all: imp cyclo in new code
This commit is contained in:
@@ -326,7 +326,7 @@ func TestServer_ProcessRestrictLocal(t *testing.T) {
|
||||
require.Len(t, pctx.Res.Answer, tc.wantLen)
|
||||
|
||||
if tc.wantLen > 0 {
|
||||
assert.Equal(t, tc.want, pctx.Res.Answer[0].Header().Name)
|
||||
assert.Equal(t, tc.want, pctx.Res.Answer[0].(*dns.PTR).Ptr)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -368,7 +368,7 @@ func TestServer_ProcessLocalPTR_usingResolvers(t *testing.T) {
|
||||
require.Equal(t, resultCodeSuccess, rc)
|
||||
require.NotEmpty(t, proxyCtx.Res.Answer)
|
||||
|
||||
assert.Equal(t, locDomain, proxyCtx.Res.Answer[0].Header().Name)
|
||||
assert.Equal(t, locDomain, proxyCtx.Res.Answer[0].(*dns.PTR).Ptr)
|
||||
})
|
||||
|
||||
t.Run("disabled", func(t *testing.T) {
|
||||
|
||||
@@ -284,7 +284,7 @@ func (s *Server) Exchange(ip net.IP) (host string, err error) {
|
||||
StartTime: time.Now(),
|
||||
}
|
||||
|
||||
var resolver *proxy.Proxy = s.internalProxy
|
||||
resolver := s.internalProxy
|
||||
if s.subnetDetector.IsLocallyServedNetwork(ip) {
|
||||
if !s.conf.UsePrivateRDNS {
|
||||
return "", nil
|
||||
|
||||
Reference in New Issue
Block a user