Skip to content

Commit 9e73e73

Browse files
authored
BUNNYDNS: Permit SRV "." targets (#4003)
Fixes #3997 # Issue BunnyDNS no longer prohibits SRV "null targets". # Resolution Permit them.
1 parent 8a8d289 commit 9e73e73

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

providers/bunnydns/auditrecords.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import (
1010
// supported, an empty list is returned.
1111
func AuditRecords(records []*models.RecordConfig) []error {
1212
a := rejectif.Auditor{}
13-
a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2024-01-02
14-
a.Add("SRV", rejectif.SrvHasNullTarget) // Last verified 2024-01-02
13+
a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2024-01-02
1514

1615
return a.Audit(records)
1716
}

providers/bunnydns/convert.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ func fromRecordConfig(rc *models.RecordConfig) (*record, error) {
4747
r.Value = strings.TrimSuffix(r.Value, ".")
4848
}
4949

50-
// In the case of SVCB/HTTPS records, the Target is part of the Value.
51-
// After removing trailing dots for said target, we can add the params to the value.
5250
switch r.Type {
5351
case recordTypeSVCB, recordTypeHTTPS:
52+
// In the case of SVCB/HTTPS records, the Target is part of the Value.
53+
// After removing trailing dots for said target, we can add the params to the value.
5454
r.Value = fmt.Sprintf("%s %s", r.Value, rc.SvcParams)
55+
case recordTypeSRV:
56+
// SRV empty target is represented as "."
57+
if r.Value == "" {
58+
r.Value = "."
59+
}
5560
}
5661

5762
return &r, nil

0 commit comments

Comments
 (0)