there is no JSON response in fast mode

This commit is contained in:
Ryan Cavicchioni 2020-03-06 01:34:05 -06:00
parent 243d0f6f31
commit c3b8d84968
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

View File

@ -71,6 +71,10 @@ func (c *Client) SetState(selector string, state State) ([]Result, error) {
defer resp.Body.Close() defer resp.Body.Close()
if state.Fast && resp.StatusCode == http.StatusAccepted {
return nil, nil
}
if err = json.NewDecoder(resp.Body).Decode(&s); err != nil { if err = json.NewDecoder(resp.Body).Decode(&s); err != nil {
log.Println(err) log.Println(err)
return nil, err return nil, err