add txt and name to query params, remove Type check

This commit is contained in:
JP 2016-08-22 14:03:32 -05:00
parent 823436d611
commit ac63d9748d

View file

@ -133,7 +133,11 @@ func (c *DNSProvider) findTxtRecord(fqdn string) (*cloudFlareRecord, error) {
return nil, err return nil, err
} }
result, err := c.makeRequest("GET", fmt.Sprintf("/zones/%s/dns_records?per_page=1000", zoneID), nil) result, err := c.makeRequest(
"GET",
fmt.Sprintf("/zones/%s/dns_records?per_page=1000&type=TXT&name=%s", zoneID, acme.UnFqdn(fqdn)),
nil,
)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -145,7 +149,7 @@ func (c *DNSProvider) findTxtRecord(fqdn string) (*cloudFlareRecord, error) {
} }
for _, rec := range records { for _, rec := range records {
if rec.Name == acme.UnFqdn(fqdn) && rec.Type == "TXT" { if rec.Name == acme.UnFqdn(fqdn) {
return &rec, nil return &rec, nil
} }
} }