u
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
Timestamp: 2026-09-27T16:12:54.346Z
|
||||
Label: GET /api/thumb/3c682aba1969f4014c3395085d39a99cad335ebb3c61fdc822a7f3f0daac1acb 500
|
||||
================================================================================
|
||||
--- request -------------------------------------------------------------------
|
||||
{
|
||||
method: "GET", url: "/api/thumb/3c682aba1969f4014c3395085d39a99cad335ebb3c61fdc822a7f3f0daac1acb"
|
||||
headers: { host: "localhost:4208", connection: "close", sec-ch-ua-platform: "\"Windows\"", user-agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.…", sec-ch-ua: "\"Chromium\";v=\"154\", \"Google Chrome\";v=\"154\", \"Not A(Brand\";v=\"99\"", sec-ch-ua-mobile: "?0", accept: "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8", sec-fetch-site: "same-origin", sec-fetch-mode: "no-cors", sec-fetch-dest: "image", referer: "http://localhost:4209/artikel/1/history", accept-encoding: "gzip, deflate, br, zstd", accept-language: "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", cookie: "g_state={\"i_l\":0,\"i_ll\":1790360080322,\"i_e\":{\"enable_itp_optimization\":24},\"i_et\":1790360080322}…" }
|
||||
params: { fullHash: "3c682aba1969f4014c3395085d39a99cad335ebb3c61fdc822a7f3f0daac1acb" }, query: {}
|
||||
}
|
||||
--- body ----------------------------------------------------------------------
|
||||
undefined
|
||||
--- files ---------------------------------------------------------------------
|
||||
undefined
|
||||
--- response ------------------------------------------------------------------
|
||||
{
|
||||
status: 500, body: { error: "no such column: c.category_id" }
|
||||
}
|
||||
--- error ---------------------------------------------------------------------
|
||||
undefined
|
||||
@@ -424,17 +424,8 @@ export function register(app, basePath = '') {
|
||||
return res.status(400).json({ error: 'url is required' });
|
||||
}
|
||||
|
||||
const abortController = new AbortController();
|
||||
const onClose = () => abortController.abort();
|
||||
req.on('close', onClose);
|
||||
res.on('close', onClose);
|
||||
|
||||
try {
|
||||
const result = await crawlAndProcessImage(rawUrl, {
|
||||
signal: abortController.signal,
|
||||
});
|
||||
|
||||
if (res.writableEnded || res.destroyed) return;
|
||||
const result = await crawlAndProcessImage(rawUrl);
|
||||
|
||||
res.setHeader('Content-Type', 'image/avif');
|
||||
res.setHeader('Content-Length', String(result.buffer.length));
|
||||
@@ -442,7 +433,6 @@ export function register(app, basePath = '') {
|
||||
res.setHeader('X-Image-Height', String(result.height));
|
||||
return res.status(200).send(result.buffer);
|
||||
} catch (err) {
|
||||
if (abortController.signal.aborted || res.writableEnded || res.destroyed) return;
|
||||
const message = err?.message || 'Failed to process image';
|
||||
const isUpstream = message.startsWith('Failed to crawl image:');
|
||||
const status = isUpstream ? 502 : 400;
|
||||
|
||||
Reference in New Issue
Block a user