mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
feat(server): add regression test for handling empty request bodies
feat(terminal): focus terminal on click fix(vite): update API proxy path to avoid frontend route conflicts
This commit is contained in:
@@ -114,7 +114,8 @@ function handlePostRequest(req: http.IncomingMessage, res: http.ServerResponse,
|
||||
|
||||
if (typeof cachedRawBody === 'string') {
|
||||
try {
|
||||
void handleBody(JSON.parse(cachedRawBody));
|
||||
const trimmed = cachedRawBody.trim();
|
||||
void handleBody(trimmed.length === 0 ? {} : JSON.parse(cachedRawBody));
|
||||
} catch (error: unknown) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
res.writeHead(500, { 'Content-Type': 'application/json' });
|
||||
@@ -128,7 +129,8 @@ function handlePostRequest(req: http.IncomingMessage, res: http.ServerResponse,
|
||||
req.on('end', async () => {
|
||||
try {
|
||||
(req as any).__ccwRawBody = body;
|
||||
const parsed = JSON.parse(body);
|
||||
const trimmed = body.trim();
|
||||
const parsed = trimmed.length === 0 ? {} : JSON.parse(body);
|
||||
(req as any).body = parsed;
|
||||
await handleBody(parsed);
|
||||
} catch (error: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user