fix: close file in LocalFileSystemProvider's Put() (#2882)

This commit is contained in:
guangwu 2024-04-20 00:11:52 +08:00 committed by GitHub
parent 66d0758b13
commit f7fb32893b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,6 +70,7 @@ func (sp LocalFileSystemProvider) Put(path string, reader io.Reader) (*oss.Objec
dst, err := os.Create(filepath.Clean(fullPath))
if err == nil {
defer dst.Close()
if seeker, ok := reader.(io.ReadSeeker); ok {
seeker.Seek(0, 0)
}