Skip to content

Commit

Permalink
fix: Type of parsedBody
Browse files Browse the repository at this point in the history
  • Loading branch information
brn committed Dec 5, 2024
1 parent 5adbb01 commit bb48cdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/sse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ export class SSEServerTransport implements Transport {
async handlePostMessage(
req: IncomingMessage,
res: ServerResponse,
parsedBody?: unknown,
parsedBody?: {[key: string]: unknown},
): Promise<void> {
if (!this._sseResponse) {
const message = "SSE connection not established";
res.writeHead(500).end(message);
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") {
Expand Down

0 comments on commit bb48cdc

Please sign in to comment.