File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,9 @@ export class SSEClientTransport implements Transport {
281281
282282 throw new Error ( `Error POSTing to endpoint (HTTP ${ response . status } ): ${ text } ` ) ;
283283 }
284+
285+ // Release connection - POST responses don't have content we need
286+ await response . body ?. cancel ( ) ;
284287 } catch ( error ) {
285288 this . onerror ?.( error as Error ) ;
286289 throw error ;
Original file line number Diff line number Diff line change @@ -592,8 +592,12 @@ export class StreamableHTTPClientTransport implements Transport {
592592 this . onmessage ?.( msg ) ;
593593 }
594594 } else {
595+ await response . body ?. cancel ( ) ;
595596 throw new StreamableHTTPError ( - 1 , `Unexpected content type: ${ contentType } ` ) ;
596597 }
598+ } else {
599+ // No requests in message but got 200 OK - still need to release connection
600+ await response . body ?. cancel ( ) ;
597601 }
598602 } catch ( error ) {
599603 this . onerror ?.( error as Error ) ;
You can’t perform that action at this time.
0 commit comments