mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 15:27:55 +08:00
just a bit safer
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user