From 5e6fad5bdfa30040f81eab82cb074314060b9e0a Mon Sep 17 00:00:00 2001 From: sergeyyarkov Date: Thu, 5 Mar 2026 16:28:27 +0300 Subject: [PATCH] upd --- handlers/reports/parseExcel.handler.js | 2 +- http-server/route.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/handlers/reports/parseExcel.handler.js b/handlers/reports/parseExcel.handler.js index f3ccca0..7bedf74 100644 --- a/handlers/reports/parseExcel.handler.js +++ b/handlers/reports/parseExcel.handler.js @@ -137,7 +137,7 @@ export default async (ctx) => { sseClientCtx.res.sendSSEJson(parseResultCount, "done"); } catch (error) { console.error(error); - sseClientCtx.res.sendSSEJson({ error: serializeError(error) }, "error"); + sseClientCtx.res.sendSSEJson({ error: serializeError(error) }, "parseError"); } finally { sseClientCtx.local.isParsing = false; } diff --git a/http-server/route.js b/http-server/route.js index e9fb372..e334bf8 100644 --- a/http-server/route.js +++ b/http-server/route.js @@ -19,7 +19,9 @@ export async function routeHandler(url, ctxStorage, routeMap) { if (url.pathname in routeMap) { const route = routeMap[url.pathname]; - if (route.method !== req.req.method) throw new MethodNotAllowedError(); + if (route.method !== req.req.method) { + throw new MethodNotAllowedError(); + } if (req.req.headers["content-type"]?.includes("application/json")) { ctx.data = await ctx.req.parseJson();