forked from TrueCloudLab/lego
hurricane: only treat first word of response body as response code (#1409)
This commit is contained in:
parent
1227bb9f10
commit
25322628e4
2 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
@ -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:
|
||||
|
|
|
@ -19,7 +19,7 @@ func TestClient_UpdateTxtRecord(t *testing.T) {
|
|||
expected: assert.NoError,
|
||||
},
|
||||
{
|
||||
code: codeNoChg,
|
||||
code: codeNoChg + ` "0123456789abcdef"`,
|
||||
expected: assert.NoError,
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue