Feature: persistence fakeip (#1662)

This commit is contained in:
Dreamacro
2021-10-11 20:48:58 +08:00
committed by GitHub
parent a1c2478e74
commit 3d5681cffd
8 changed files with 364 additions and 73 deletions

View File

@ -67,7 +67,7 @@ func (h *ResolverEnhancer) PatchFrom(o *ResolverEnhancer) {
}
if h.fakePool != nil && o.fakePool != nil {
h.fakePool.PatchFrom(o.fakePool)
h.fakePool.CloneFrom(o.fakePool)
}
}

View File

@ -107,7 +107,7 @@ func withFakeIP(fakePool *fakeip.Pool) middleware {
q := r.Question[0]
host := strings.TrimRight(q.Name, ".")
if fakePool.LookupHost(host) {
if fakePool.ShouldSkipped(host) {
return next(ctx, r)
}