From 46fc5d3601d0043ec55327aeb831d1ef24edbbbc Mon Sep 17 00:00:00 2001 From: Alex Schittko Date: Sat, 13 Jul 2024 07:46:12 +0000 Subject: [PATCH] Refactor --- tunneldns/tunnel.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tunneldns/tunnel.go b/tunneldns/tunnel.go index 3d7dd4b0..05f72ee8 100644 --- a/tunneldns/tunnel.go +++ b/tunneldns/tunnel.go @@ -94,14 +94,15 @@ func CreateListener(address string, port uint16, upstreams []string, bootstraps // Create a local cache with HTTPS proxy plugin - chain := cache.New() - chain.Next = ProxyPlugin{ + proxyPlugin := ProxyPlugin{ Upstreams: upstreamList, - } + } + chain := cache.New() + chain.Next = proxyPlugin // Optionally disable http response caching if os.Getenv("DISABLE_TUNNELDNS_CACHE") == "true" { - chain.Next = ProxyPlugin{} + chain = proxyPlugin } // Format an endpoint