Update upload.ts

This commit is contained in:
Caleb Denio 2024-05-05 17:30:59 -04:00 committed by GitHub
parent fc24df2e2b
commit 03d9656c0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,7 +46,7 @@ const upload = async (url: string, authorization: string | null) => {
export default async (req: Request) => { export default async (req: Request) => {
if (!ensurePost(req)) return null; if (!ensurePost(req)) return null;
const body =await req.arrayBuffer(); const body = new TextDecoder().decode(await req.arrayBuffer());
const uploadedFileUrl = await upload(body, req.headers.get("Authorization")); const uploadedFileUrl = await upload(body, req.headers.get("Authorization"));
return new Response(JSON.stringify(uploadedFileUrl)); return new Response(JSON.stringify(uploadedFileUrl));