Skip to content

Commit

Permalink
fix: quote TXT & SPF records
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Oct 4, 2022
1 parent 8daa364 commit 77dff68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (p *Provider) getZoneID(ctx context.Context, zoneName string) (string, erro

func (p *Provider) createRecord(ctx context.Context, zoneID string, record libdns.Record, zone string) (libdns.Record, error) {
// AWS Route53 TXT record value must be enclosed in quotation marks on create
if record.Type == "TXT" {
if record.Type == "TXT" || record.Type == "SPF" {
record.Value = strconv.Quote(record.Value)
}

Expand Down Expand Up @@ -181,7 +181,7 @@ func (p *Provider) createRecord(ctx context.Context, zoneID string, record libdn

func (p *Provider) updateRecord(ctx context.Context, zoneID string, record libdns.Record, zone string) (libdns.Record, error) {
// AWS Route53 TXT record value must be enclosed in quotation marks on update
if record.Type == "TXT" {
if record.Type == "TXT" || record.Type == "SPF" {
record.Value = strconv.Quote(record.Value)
}

Expand Down

0 comments on commit 77dff68

Please sign in to comment.