Skip to content

Commit c574dcc

Browse files
authored
Fixes #25: parse problems Cloudflare SRV records (#26)
1 parent e8dfdd0 commit c574dcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ func (r cfDNSRecord) libdnsRecord(zone string) (libdns.Record, error) {
166166
Target: r.Content,
167167
}, nil
168168
case "SRV":
169-
parts := strings.SplitN(name, ".", 3)
169+
parts := strings.SplitN(r.Name, ".", 3)
170170
if len(parts) < 3 {
171-
return libdns.SRV{}, fmt.Errorf("name %v does not contain enough fields; expected format: '_service._proto.name'", name)
171+
return libdns.SRV{}, fmt.Errorf("name %v does not contain enough fields; expected format: '_service._proto.name'", r.Name)
172172
}
173173
return libdns.SRV{
174174
Service: strings.TrimPrefix(parts[0], "_"),

0 commit comments

Comments
 (0)