mirror of https://github.com/usual2970/certimate
fix: ignore wangsu api responses without content
parent
7329a22132
commit
eb45b56a87
|
@ -178,8 +178,11 @@ func (c *Client) SendRequestWithResult(method string, path string, params interf
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal(resp.Body(), &result); err != nil {
|
respBody := resp.Body()
|
||||||
return resp, fmt.Errorf("wangsu api error: failed to parse response: %w", err)
|
if len(respBody) != 0 {
|
||||||
|
if err := json.Unmarshal(respBody, &result); err != nil {
|
||||||
|
return resp, fmt.Errorf("wangsu api error: failed to parse response: %w", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result.SetRequestId(resp.Header().Get("x-cnc-request-id"))
|
result.SetRequestId(resp.Header().Get("x-cnc-request-id"))
|
||||||
|
|
Loading…
Reference in New Issue