Add check for port at the end
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Not ideal but functional

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-10-16 16:11:37 +02:00
parent bf0e44e80c
commit a3f0c6d49a
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
2 changed files with 8 additions and 3 deletions

View file

@ -141,7 +141,6 @@ local release() = {
from_secret: 'DRONE_TOKEN',
},
},
fork: true,
repositories: [
'packages/awl',
],

View file

@ -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,