add missing defer

This commit is contained in:
Hekmon 2022-04-29 11:43:43 +02:00
parent aa3f8e1b34
commit 187a0c8817
No known key found for this signature in database
GPG key ID: 8C27AA76AB6EFF96

View file

@ -244,6 +244,7 @@ func (c *Crunchyroll) request(endpoint string) (*http.Response, error) {
resp, err := c.Client.Do(req)
if err == nil {
defer resp.Body.Close()
bodyAsBytes, _ := io.ReadAll(resp.Body)
defer resp.Body.Close()
if resp.StatusCode == http.StatusUnauthorized {