Skip to content

Commit 2fa33e3

Browse files
authored
Handle 204 No Content status in response processing
Fixes #1303
1 parent 2b20ca9 commit 2fa33e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client/streamableHttp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ export class StreamableHTTPClientTransport implements Transport {
555555
this._hasCompletedAuthFlow = false;
556556
this._lastUpscopingHeader = undefined;
557557

558-
// If the response is 202 Accepted, there's no body to process
559-
if (response.status === 202) {
558+
// If the response is 202 Accepted or 204 No Content, there's no body to process
559+
if (response.status === 202 || response.status === 204) {
560560
await response.body?.cancel();
561561
// if the accepted notification is initialized, we start the SSE stream
562562
// if it's supported by the server

0 commit comments

Comments
 (0)