Skip to content

Commit 7bda8c3

Browse files
committed
fix(uploads): trust HEAD size to prevent quota inflation
The head.size > 0 fallback let a client PUT 0 bytes and register with an inflated size, debiting quota without storing data. HEAD on an existing object always returns the true byte count, so trust it directly — a genuine 0-byte file correctly contributes 0.
1 parent 08bdd26 commit 7bda8c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export async function registerUploadedWorkspaceFile(params: {
305305
if (!head) {
306306
throw new Error('Uploaded object not found in storage')
307307
}
308-
verifiedSize = head.size > 0 ? head.size : size
308+
verifiedSize = head.size
309309
}
310310

311311
const cleanupOrphan = async (reason: string) => {

0 commit comments

Comments
 (0)