mirror of
https://github.com/System-End/cdn.git
synced 2026-04-19 19:45:07 +00:00
I request your attention.
This commit is contained in:
parent
0dde879c7a
commit
0ea37a4811
4 changed files with 4 additions and 4 deletions
|
|
@ -79,7 +79,7 @@ export default async (req: Request) => {
|
|||
}
|
||||
|
||||
const decoder = new TextDecoder();
|
||||
const buf = await request.arrayBuffer();
|
||||
const buf = await req.arrayBuffer();
|
||||
const fileURLs = JSON.parse(decoder.decode(buf));
|
||||
if (!Array.isArray(fileURLs) || fileURLs.length < 1) {
|
||||
return new Response(
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export default async (req: Request) => {
|
|||
}
|
||||
|
||||
const decoder = new TextDecoder();
|
||||
const buf = await request.arrayBuffer();
|
||||
const buf = await req.arrayBuffer();
|
||||
const singleFileURL = decoder.decode(buf);
|
||||
if (typeof singleFileURL != "string") {
|
||||
return new Response(
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { ensurePost, parseBody } from "./utils.ts";
|
|||
export default async (req: Request) => {
|
||||
if (!ensurePost(req)) return null;
|
||||
|
||||
const body = await request.arrayBuffer();
|
||||
const body = await req.arrayBuffer();
|
||||
const fileURLs = JSON.parse(body);
|
||||
|
||||
if (!Array.isArray(fileURLs) || fileURLs.length < 1) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const upload = async (url: string, authorization: string | null) => {
|
|||
export default async (req: Request) => {
|
||||
if (!ensurePost(req)) return null;
|
||||
|
||||
const body =await request.arrayBuffer();
|
||||
const body =await req.arrayBuffer();
|
||||
const uploadedFileUrl = await upload(body, req.headers.get("Authorization"));
|
||||
|
||||
return new Response(JSON.stringify(uploadedFileUrl));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue