Skip to content

Commit

Permalink
hurricane: only treat first word of response body as response code (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnovakovic authored May 24, 2021
1 parent 1227bb9 commit 2532262
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion providers/dns/hurricane/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"net/http"
"net/url"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -80,7 +81,9 @@ func (c *Client) UpdateTxtRecord(domain string, txt string) error {
}

func evaluateBody(body string, hostname string) error {
switch body {
words := strings.SplitN(body, " ", 2)

switch words[0] {
case codeGood:
return nil
case codeNoChg:
Expand Down
2 changes: 1 addition & 1 deletion providers/dns/hurricane/internal/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestClient_UpdateTxtRecord(t *testing.T) {
expected: assert.NoError,
},
{
code: codeNoChg,
code: codeNoChg + ` "0123456789abcdef"`,
expected: assert.NoError,
},
{
Expand Down

0 comments on commit 2532262

Please sign in to comment.