style: auto-fix linting issues

This commit is contained in:
EduardPrigoanaAlt 2026-02-21 16:49:15 +00:00 committed by github-actions[bot]
parent 8c77b18073
commit 812178e3f3

View file

@ -67,16 +67,19 @@ export async function onRequest(context) {
} }
if (uploadedFile.size > 500 * 1024 * 1024) { if (uploadedFile.size > 500 * 1024 * 1024) {
return new Response(JSON.stringify({ return new Response(
JSON.stringify({
error: 'File size exceeds 500MB limit', error: 'File size exceeds 500MB limit',
size: uploadedFile.size, size: uploadedFile.size,
}), { }),
{
status: 400, status: 400,
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
}, },
}); }
);
} }
file = await uploadedFile.arrayBuffer(); file = await uploadedFile.arrayBuffer();
@ -162,28 +165,34 @@ export async function onRequest(context) {
const publicUrl = `https://i.imgur.gg/${fileInfo.fileId}-${fileInfo.fileName}`; const publicUrl = `https://i.imgur.gg/${fileInfo.fileId}-${fileInfo.fileName}`;
return new Response(JSON.stringify({ return new Response(
JSON.stringify({
success: true, success: true,
url: publicUrl, url: publicUrl,
fileId: fileInfo.fileId, fileId: fileInfo.fileId,
fileName: fileInfo.fileName, fileName: fileInfo.fileName,
}), { }),
{
status: 200, status: 200,
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
}, },
}); }
);
} catch (error) { } catch (error) {
return new Response(JSON.stringify({ return new Response(
JSON.stringify({
error: 'Upload failed', error: 'Upload failed',
message: error.message, message: error.message,
}), { }),
{
status: 500, status: 500,
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Origin': '*',
}, },
}); }
);
} }
} }