pull/2765/head
demoManito 2 years ago
parent 0e675cf852
commit ac10c67d30
  1. 8
      contrib/registry/eureka/client.go

@ -324,10 +324,7 @@ func (e *Client) request(ctx context.Context, method string, params []string, in
_ = resp.Body.Close()
}()
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNoContent {
if output == nil {
return false, nil
}
if resp.StatusCode == http.StatusOK {
data, err := io.ReadAll(resp.Body)
if err != nil {
return false, err
@ -338,6 +335,9 @@ func (e *Client) request(ctx context.Context, method string, params []string, in
}
return false, nil
}
if resp.StatusCode == http.StatusNoContent {
return false, nil
}
return false, fmt.Errorf("response error %d", resp.StatusCode)
}

Loading…
Cancel
Save