From a3f0c6d49aca70918b03b0466bef94f56bea1323 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Sun, 16 Oct 2022 16:11:37 +0200 Subject: [PATCH] Add check for port at the end Not ideal but functional Signed-off-by: Sam Therapy --- .drone.jsonnet | 1 - pkg/resolvers/resolver.go | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 05b7f2a..c5e4325 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -141,7 +141,6 @@ local release() = { from_secret: 'DRONE_TOKEN', }, }, - fork: true, repositories: [ 'packages/awl', ], diff --git a/pkg/resolvers/resolver.go b/pkg/resolvers/resolver.go index 1bc96de..28a8998 100644 --- a/pkg/resolvers/resolver.go +++ b/pkg/resolvers/resolver.go @@ -36,7 +36,10 @@ func LoadResolver(opts *util.Options) (Resolver, error) { }, nil case opts.QUIC: opts.Logger.Info("loading DNS-over-QUIC resolver") - opts.Request.Server = net.JoinHostPort(opts.Request.Server, strconv.Itoa(opts.Request.Port)) + + if !strings.HasSuffix(opts.Request.Server, ":"+strconv.Itoa(opts.Request.Port)) { + opts.Request.Server = net.JoinHostPort(opts.Request.Server, strconv.Itoa(opts.Request.Port)) + } return &QUICResolver{ opts: opts, @@ -53,7 +56,10 @@ func LoadResolver(opts *util.Options) (Resolver, error) { }, nil default: opts.Logger.Info("loading standard/DNS-over-TLS resolver") - opts.Request.Server = net.JoinHostPort(opts.Request.Server, strconv.Itoa(opts.Request.Port)) + + if !strings.HasSuffix(opts.Request.Server, ":"+strconv.Itoa(opts.Request.Port)) { + opts.Request.Server = net.JoinHostPort(opts.Request.Server, strconv.Itoa(opts.Request.Port)) + } return &StandardResolver{ opts: opts,