Skip to content

Commit 297ac54

Browse files
authored
Merge pull request #21 from kevinscholz/add-quote-to-record-value
Add quote to record value
2 parents d7c2146 + 415543d commit 297ac54

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"net"
66
"net/http"
77
"os"
8+
"strconv"
89
"strings"
910
"time"
1011

@@ -61,8 +62,12 @@ func (c *designateDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) erro
6162

6263
var opts recordsets.CreateOpts
6364
opts.Name = ch.ResolvedFQDN
64-
opts.Records = []string{ch.Key}
6565
opts.Type = "TXT"
66+
if strings.HasPrefix(ch.Key, "\"") {
67+
opts.Records = []string{ch.Key}
68+
} else {
69+
opts.Records = []string{strconv.Quote(ch.Key)}
70+
}
6671

6772
_, err = recordsets.Create(c.client, allZones[0].ID, opts).Extract()
6873
if err != nil {

0 commit comments

Comments
 (0)