mirror of
https://github.com/go-acme/lego.git
synced 2025-01-18 12:30:36 +02:00
hurricane: only treat first word of response body as response code (#1409)
This commit is contained in:
parent
1227bb9f10
commit
25322628e4
@ -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 New Issue
Block a user