mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-11-10 09:12:47 +08: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:
parent
b8096b7b8a
commit
32fe2753d8
1 changed files with 10 additions and 1 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -156,7 +157,15 @@ func (c *porkbunProvider) getNameservers(domain string) ([]string, error) {
|
||||||
json.Unmarshal(bodyString, &ns)
|
json.Unmarshal(bodyString, &ns)
|
||||||
|
|
||||||
sort.Strings(ns.Nameservers)
|
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 {
|
func (c *porkbunProvider) updateNameservers(ns []string, domain string) error {
|
||||||
|
|
Loading…
Reference in a new issue