Skip to content

Commit 69069f2

Browse files
authored
Modify handleMessage to check request method (#22)
* Modify handleMessage to check request method * Update deno.json
1 parent ee6197d commit 69069f2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deco/mcp",
3-
"version": "0.7.7",
3+
"version": "0.7.8",
44
"exports": {
55
".": "./mod.ts",
66
"./http": "./mcp/http.ts"

mcp/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class HttpServerTransport extends StreamableHTTPServerTransport {
2020

2121
async handleMessage(req: Request): Promise<Response> {
2222
const { req: nodeReq, res } = toReqRes(req);
23-
super.handleRequest(nodeReq, res, await req.json().catch(() => null));
23+
super.handleRequest(nodeReq, res, req.method === "GET" ? null : await req.json().catch(() => null));
2424
return toFetchResponse(res);
2525
}
2626
}

0 commit comments

Comments
 (0)