Add check for port at the end #142

Merged
sam merged 1 commit from fix-141 into master 2022-10-16 14:25:13 +00:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit a3f0c6d49a - Show all commits

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,