Browse Source

just a bit safer

pull/3570/head
chrislu 2 years ago
parent
commit
ef78631a7c
  1. 3
      weed/util/http_util.go

3
weed/util/http_util.go

@ -408,6 +408,9 @@ func ReadUrlAsReaderCloser(fileUrl string, jwt string, rangeHeader string) (*htt
}
func CloseResponse(resp *http.Response) {
if resp == nil || resp.Body == nil {
return
}
reader := &CountingReader{reader: resp.Body}
io.Copy(io.Discard, reader)
resp.Body.Close()

Loading…
Cancel
Save