Skip to content

Commit b9e4223

Browse files
committed
feat: Add a rawBody optional parameter
1 parent becd787 commit b9e4223

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/server/sse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class SSEServerTransport implements Transport {
6868
async handlePostMessage(
6969
req: IncomingMessage,
7070
res: ServerResponse,
71+
rawBody?: string
7172
): Promise<void> {
7273
if (!this._sseResponse) {
7374
const message = "SSE connection not established";
@@ -82,7 +83,7 @@ export class SSEServerTransport implements Transport {
8283
throw new Error(`Unsupported content-type: ${ct}`);
8384
}
8485

85-
body = await getRawBody(req, {
86+
body = rawBody ?? await getRawBody(req, {
8687
limit: MAXIMUM_MESSAGE_SIZE,
8788
encoding: ct.parameters.charset ?? "utf-8",
8889
});

0 commit comments

Comments
 (0)