Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

just a bit safer

chrisluef78631a7c2a
diff --git a/weed/util/http_util.go b/weed/util/http_util.go
index 748bb6e87c..bb1a32ede6 100644
--- a/weed/util/http_util.go
+++ b/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()