Skip to content

Commit f6351db

Browse files
Update src/ModelContextProtocol.AspNetCore/StreamableHttpHandler.cs
Co-authored-by: Stephen Halter <halter73@gmail.com>
1 parent 7728c70 commit f6351db

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/ModelContextProtocol.AspNetCore/StreamableHttpHandler.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,8 @@ private void ScheduleStatelessSessionIdWrite(HttpContext context, StreamableHttp
299299

300300
var sessionJson = JsonSerializer.Serialize(statelessId, StatelessSessionIdJsonContext.Default.StatelessSessionId);
301301
transport.SessionId = Protector.Protect(sessionJson);
302-
};
303-
304-
context.Response.OnStarting(() =>
305-
{
306-
Debug.Assert(transport.SessionId is not null);
307302
context.Response.Headers["mcp-session-id"] = transport.SessionId;
308-
return Task.CompletedTask;
309-
});
303+
};
310304
}
311305

312306
internal static Task RunSessionAsync(HttpContext httpContext, IMcpServer session, CancellationToken requestAborted)

0 commit comments

Comments
 (0)