CLOUDFLAREAPI: Now works with PunyCode/IDNA (#1019)

This commit is contained in:
Tom Limoncelli 2021-01-14 09:53:06 -05:00 committed by GitHub
parent 6efedd689d
commit 0893f74895
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -767,9 +767,8 @@ func makeTests(t *testing.T) []*TestGroup {
),
testgroup("IDNA",
not("SOFTLAYER", "CLOUDFLAREAPI"),
not("SOFTLAYER"),
// SOFTLAYER: fails at direct internationalization, punycode works, of course.
// CLOUDFLAREAPI: fails. Needs to be debugged.
tc("Internationalized name", a("ööö", "1.2.3.4")),
tc("Change IDN", a("ööö", "2.2.2.2")),
tc("Internationalized CNAME Target", cname("a", "ööö.com.")),

View file

@ -149,6 +149,11 @@ func (c *cloudflareProvider) getDomainID(name string) (string, error) {
// GetDomainCorrections returns a list of corrections to update a domain.
func (c *cloudflareProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
err := dc.Punycode()
if err != nil {
return nil, err
}
id, err := c.getDomainID(dc.Name)
if err != nil {
return nil, err