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,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…
x
Reference in New Issue
Block a user