finalized archiveHandler/background worker logic

This commit is contained in:
daniel31x13
2023-12-13 17:32:01 -05:00
parent a001f70b9d
commit b74ff01ce6
13 changed files with 292 additions and 403 deletions
+2 -1
View File
@@ -4,7 +4,8 @@ export default async function validateUrlSize(url: string) {
const totalSizeMB =
Number(response.headers.get("content-length")) / Math.pow(1024, 2);
if (totalSizeMB > 50) return null;
if (totalSizeMB > (Number(process.env.NEXT_PUBLIC_MAX_FILE_SIZE) || 30))
return null;
else return response.headers;
} catch (err) {
console.log(err);