mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-18 17:31:55 +08:00
fix: ignore wangsu api responses without content
This commit is contained in:
parent
7329a22132
commit
eb45b56a87
@ -178,9 +178,12 @@ func (c *Client) SendRequestWithResult(method string, path string, params interf
|
||||
return resp, err
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(resp.Body(), &result); err != nil {
|
||||
respBody := resp.Body()
|
||||
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"))
|
||||
return resp, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user