mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
fix: nil pointer deference on HttpGetBytes.
This commit is contained in:
parent
2309d511bb
commit
6e4bbb9e42
@ -20,10 +20,10 @@ var client = &http.Client{
|
|||||||
// HttpGetBytes 带 cookie 的 GET 请求
|
// HttpGetBytes 带 cookie 的 GET 请求
|
||||||
func HttpGetBytes(url, cookie string) ([]byte, error) {
|
func HttpGetBytes(url, cookie string) ([]byte, error) {
|
||||||
body, err := HTTPGetReadCloser(url, cookie)
|
body, err := HTTPGetReadCloser(url, cookie)
|
||||||
defer func() { _ = body.Close() }()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
defer func() { _ = body.Close() }()
|
||||||
return io.ReadAll(body)
|
return io.ReadAll(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user