Fix race condition in SSE GET request initialization (#1212)
This commit is contained in:
parent
8e57ac6b0e
commit
f9dec13660
1 changed files with 6 additions and 5 deletions
|
|
@ -154,11 +154,6 @@ internal sealed class StreamableHttpHandler(
|
|||
{
|
||||
await using var _ = await session.AcquireReferenceAsync(cancellationToken);
|
||||
InitializeSseResponse(context);
|
||||
|
||||
// We should flush headers to indicate a 200 success quickly, because the initialization response
|
||||
// will be sent in response to a different POST request. It might be a while before we send a message
|
||||
// over this response body.
|
||||
await context.Response.Body.FlushAsync(cancellationToken);
|
||||
await session.Transport.HandleGetRequestAsync(context.Response.Body, cancellationToken);
|
||||
}
|
||||
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
|
||||
|
|
|
|||
Loading…
Reference in a new issue