1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

BUGFIX: CAA records may include quoted spaces #1374 (#1377)

This commit is contained in:
Tom Limoncelli
2022-01-25 09:57:20 -05:00
committed by GitHub
parent 263c6b7290
commit b73d37908c
4 changed files with 49 additions and 4 deletions

View File

@ -3,7 +3,6 @@ package models
import (
"fmt"
"strconv"
"strings"
)
// SetTargetCAA sets the CAA fields.
@ -37,7 +36,10 @@ func (rc *RecordConfig) SetTargetCAAStrings(flag, tag, target string) error {
// SetTargetCAAString is like SetTargetCAA but accepts one big string.
// Ex: `0 issue "letsencrypt.org"`
func (rc *RecordConfig) SetTargetCAAString(s string) error {
part := strings.Fields(s)
part, err := ParseQuotedFields(s)
if err != nil {
return err
}
if len(part) != 3 {
return fmt.Errorf("CAA value does not contain 3 fields: (%#v)", s)
}