Parcourir la source

fix powerdns records typo and status response

Alexander Belanger il y a 4 ans
Parent
commit
3b98776063
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      internal/integrations/powerdns/powerdns.go

+ 2 - 2
internal/integrations/powerdns/powerdns.go

@@ -39,7 +39,7 @@ type RR struct {
 	Type       string   `json:"type"`
 	ChangeType string   `json:"changetype"`
 	TTL        uint     `json:"ttl"`
-	Records    []Record `json:"record"`
+	Records    []Record `json:"records"`
 }
 
 type Record struct {
@@ -139,7 +139,7 @@ func (c *Client) sendRequest(method string, data *RecordData) error {
 
 	defer res.Body.Close()
 
-	if res.StatusCode != http.StatusOK && res.StatusCode != http.StatusCreated {
+	if res.StatusCode < http.StatusOK || res.StatusCode >= http.StatusBadRequest {
 		resBytes, err := ioutil.ReadAll(res.Body)
 
 		if err != nil {