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

DNSIMPLE: do not support unpaired double quotes in TXT (#1610)

* DNSIMPLE: do not support unpaired double quotes in TXT

DNSimple supports multiple double-quotes strings in a TXT record, but does not correctly support unpaired or escaped double-quotes currently.

IE the following are valid
```
asdf
"asdf"
"asdf" "asdf"
!@#$ %^&*()([][{}{<></'`:;-_=+\
```

however `as\"df` and `as"df` are not

This removes the extra string processing in getTargetRecordPriority as all tests pass without it and currently only double-quotes cause problems in our TXT validations.

I added another test to prove additional quoting is not needed. We can remove it if undesired.

Also applied small lint changes to make my editor happy.

* Use backticks to prevent escaping

* Set TXT target record content to GetTargetRFC1035Quoted()

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Amelia Aronsohn
2022-07-11 11:52:18 -07:00
committed by GitHub
parent 14ae3732b6
commit b0d80ae498
3 changed files with 15 additions and 33 deletions

View File

@ -905,6 +905,8 @@ func makeTests(t *testing.T) []*TestGroup {
tc("Create TXT with double-quote", txt("foodq", `quo"te`)),
clear(),
tc("Create TXT with ws at end", txt("foows1", "with space at end ")),
clear(),
tc("Create TXT with frequently escaped characters", txt("fooex", `!^.*$@#%^&()([][{}{<></:;-_=+\`)),
),
//