ebitenutil: close an HTTP response body (#2971)

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guangwu 2024-04-29 08:43:11 +08:00 committed by GitHub
parent f43c237c00
commit 97a9ee9601
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,6 +40,7 @@ func OpenFile(path string) (ReadSeekCloser, error) {
if err != nil {
return nil, err
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
return nil, err