This commit is contained in:
Anaïs Saraiva
2026-08-15 00:54:04 +02:00
parent ad469460a4
commit f735c64e62
9 changed files with 97 additions and 29 deletions
+2
View File
@@ -25,6 +25,7 @@ export async function handleUpload(
req: Request,
storage: Storage,
maxFileSize: number,
ttlMs: number,
): Promise<Response> {
const contentType = req.headers.get("content-type");
const boundary = contentType ? getBoundary(contentType) : null;
@@ -73,6 +74,7 @@ export async function handleUpload(
downloadKeyHash: hashSecret(key),
passwordHash: hashPassword(password),
createdAt: new Date().toISOString(),
expiresAt: new Date(Date.now() + ttlMs).toISOString(),
});
log("info", `upload ok id=${id} size=${size} name=${JSON.stringify(originalName)}`);