mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-10 06:06:09 +08:00
INWX: use domain ACE encoding as cache key (#3519)
This commit is contained in:
parent
03932c9c1a
commit
07ffb3ab58
1 changed files with 9 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import (
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/nrdcg/goinwx"
|
"github.com/nrdcg/goinwx"
|
||||||
"github.com/pquerna/otp/totp"
|
"github.com/pquerna/otp/totp"
|
||||||
|
"golang.org/x/net/idna"
|
||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
|
|
@ -566,7 +567,14 @@ func (api *inwxAPI) fetchNameserverDomains() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, domain := range info.Domains {
|
for _, domain := range info.Domains {
|
||||||
zones[domain.Domain] = domain.RoID
|
// If this is an IDN domain, Nameservers.List.Domains[].Domain
|
||||||
|
// will contain the Unicode name but subsequent calls use the ACE
|
||||||
|
// encoded name. We will convert it now for use as the cache key
|
||||||
|
aceName, err := idna.ToASCII(domain.Domain)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
zones[aceName] = domain.RoID
|
||||||
}
|
}
|
||||||
if len(zones) >= info.Count {
|
if len(zones) >= info.Count {
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue