Skip to content

Commit

Permalink
PORKBUN: Improve non .DE domain delegation processing (remove the tra…
Browse files Browse the repository at this point in the history
…iling dot in NS) (#2624)

Co-authored-by: Tom Limoncelli <[email protected]>
  • Loading branch information
imlonghao and tlimoncelli authored Nov 16, 2023
1 parent b8096b7 commit 32fe275
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion providers/porkbun/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"net/http"
"sort"
"strings"
"time"
)

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 32fe275

Please sign in to comment.