mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
just a bit safer
This commit is contained in:
parent
9c944377dc
commit
ef78631a7c
|
@ -408,6 +408,9 @@ func ReadUrlAsReaderCloser(fileUrl string, jwt string, rangeHeader string) (*htt
|
||||||
}
|
}
|
||||||
|
|
||||||
func CloseResponse(resp *http.Response) {
|
func CloseResponse(resp *http.Response) {
|
||||||
|
if resp == nil || resp.Body == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
reader := &CountingReader{reader: resp.Body}
|
reader := &CountingReader{reader: resp.Body}
|
||||||
io.Copy(io.Discard, reader)
|
io.Copy(io.Discard, reader)
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
|
Loading…
Reference in a new issue