From bb48cdc33d312209b481e68d5ffd55e7157c3a95 Mon Sep 17 00:00:00 2001 From: brn Date: Thu, 5 Dec 2024 13:17:21 +0900 Subject: [PATCH] fix: Type of parsedBody --- src/server/sse.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/sse.ts b/src/server/sse.ts index fe03182..341b4ea 100644 --- a/src/server/sse.ts +++ b/src/server/sse.ts @@ -68,7 +68,7 @@ export class SSEServerTransport implements Transport { async handlePostMessage( req: IncomingMessage, res: ServerResponse, - parsedBody?: unknown, + parsedBody?: {[key: string]: unknown}, ): Promise { if (!this._sseResponse) { const message = "SSE connection not established"; @@ -76,7 +76,7 @@ export class SSEServerTransport implements Transport { throw new Error(message); } - let body: string | unknown; + let body: string | typeof parsedBody; try { const ct = contentType.parse(req.headers["content-type"] ?? ""); if (ct.type !== "application/json") {