diff options
| author | Adam Soltys <[email protected]> | 2024-01-09 23:10:35 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-01-09 23:10:39 -0800 |
| commit | 7a84d2555ffabbe29b23cf6e5035b6a4be8b9eb6 (patch) | |
| tree | 9fe2b7d523bbfe34176f115cb6823403fef1f802 /lib/upload.js | |
| parent | e06878e18fc33e392fd16b76d1ab9f25f8bc7fbe (diff) | |
| download | coinos-server-7a84d2555ffabbe29b23cf6e5035b6a4be8b9eb6.tar.gz coinos-server-7a84d2555ffabbe29b23cf6e5035b6a4be8b9eb6.zip | |
remove users from archive once migrated
Diffstat (limited to 'lib/upload.js')
| -rw-r--r-- | lib/upload.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/upload.js b/lib/upload.js index 9bc41388..dc311922 100644 --- a/lib/upload.js +++ b/lib/upload.js @@ -6,6 +6,7 @@ import path from "path"; import sharp from "sharp"; import { pipeline } from "stream"; import { g, s, db } from "$lib/db"; +import { fail } from "$lib/utils"; import crypto from "crypto"; async function getSha256Hash(stream) { @@ -40,7 +41,7 @@ export default async (req, res) => { let [format, ext] = (await fileTypeFromStream(s1)).mime.split("/"); if (format !== "image" && !["jpg", "jpeg", "png"].includes(ext)) - throw new Error("unsupported file type"); + fail("unsupported file type"); let t = sharp().rotate().resize(width).webp(); |
