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") {