pull/2765/head
demoManito 2 years ago
parent ac10c67d30
commit c02151607b
  1. 6
      contrib/registry/eureka/client.go

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

Loading…
Cancel
Save