fix: close resp body

This commit is contained in:
guangwu 2024-04-17 17:47:47 +08:00 committed by yuhan6665
parent befa7b8138
commit 12f5b05aca

View file

@ -222,6 +222,7 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
if resp, err = client.Do(req); err != nil { if resp, err = client.Do(req); err != nil {
break break
} }
defer resp.Body.Close()
req.Header.Set("Referer", req.URL.String()) req.Header.Set("Referer", req.URL.String())
if body, err = io.ReadAll(resp.Body); err != nil { if body, err = io.ReadAll(resp.Body); err != nil {
break break