Skip to content

Commit aee96c9

Browse files
authored
fix: set fileSize to full length instead of unread portion (#18409)
`content.Len()` would return `0` bytes after a file was fully read. Since the buffer `Len` function returns the length of the unread portion.
1 parent 7fa1ad8 commit aee96c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coderd/files/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func NewFromStore(store database.Store, registerer prometheus.Registerer, authz
3535
return CacheEntryValue{
3636
Object: file.RBACObject(),
3737
FS: archivefs.FromTarReader(content),
38-
Size: int64(content.Len()),
38+
Size: int64(len(file.Data)),
3939
}, nil
4040
}
4141

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy