From a7af67e068e9dd035397f818a112a6755d51f54c Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 23 Dec 2015 21:45:28 +0100 Subject: wip --- client.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 84906b5..c1e0e91 100644 --- a/client.go +++ b/client.go @@ -239,7 +239,7 @@ func (c *Client) Authorize(a *Account, domain []string) error { } log.Println(az) log.Println(ra) - for _, ch := range az.Challenges { + for _, ch := range az { switch ch.Status { case StatusPending, StatusProcessing: default: @@ -252,7 +252,7 @@ func (c *Client) Authorize(a *Account, domain []string) error { return err } -func (c *Client) Status(url string) (*Authorization, time.Duration, error) { +func (c *Client) Status(url string) ([]Challenge, time.Duration, error) { r := &Authorization{} resp, err := http.Get(url) if err != nil { @@ -261,7 +261,8 @@ func (c *Client) Status(url string) (*Authorization, time.Duration, error) { defer resp.Body.Close() defer c.replyNonce(resp) ns := parseHeader(resp) - return r, ns.RetryAfter, json.NewDecoder(resp.Body).Decode(r) + err = json.NewDecoder(resp.Body).Decode(r) + return r.Challenges, ns.RetryAfter, err } //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3