Don't log OperationCanceledException every time an HMR client disconnects
This commit is contained in:
parent
8396be24c8
commit
5e7bb0f5c5
|
|
@ -98,7 +98,15 @@ namespace Microsoft.AspNetCore.SpaServices.Webpack
|
||||||
|
|
||||||
using (var responseStream = await responseMessage.Content.ReadAsStreamAsync())
|
using (var responseStream = await responseMessage.Content.ReadAsStreamAsync())
|
||||||
{
|
{
|
||||||
await responseStream.CopyToAsync(context.Response.Body, DefaultHttpBufferSize, context.RequestAborted);
|
try
|
||||||
|
{
|
||||||
|
await responseStream.CopyToAsync(context.Response.Body, DefaultHttpBufferSize, context.RequestAborted);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
// The CopyToAsync task will be canceled if the client disconnects (e.g., user
|
||||||
|
// closes or refreshes the browser tab). Don't treat this as an error.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue