mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
PORKBUN: Improve non .DE domain delegation processing (remove the trailing dot in NS) (#2624)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -156,7 +157,15 @@ func (c *porkbunProvider) getNameservers(domain string) ([]string, error) {
|
||||
json.Unmarshal(bodyString, &ns)
|
||||
|
||||
sort.Strings(ns.Nameservers)
|
||||
return ns.Nameservers, nil
|
||||
|
||||
var nameservers []string
|
||||
for _, nameserver := range ns.Nameservers {
|
||||
// Remove the trailing dot only if it exists.
|
||||
// This provider seems to add the trailing dot to some domains but not others.
|
||||
// The .DE domains seem to always include the dot, others don't.
|
||||
nameservers = append(nameservers, strings.TrimSuffix(nameserver, "."))
|
||||
}
|
||||
return nameservers, nil
|
||||
}
|
||||
|
||||
func (c *porkbunProvider) updateNameservers(ns []string, domain string) error {
|
||||
|
Reference in New Issue
Block a user