Improved request error handling.
This commit is contained in:
Родитель
28d56fe3fc
Коммит
a8e4f69fc7
|
@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
|
|||
{
|
||||
LogHelper.LogException(_logger, "ListenForNextRequestAsync", exception);
|
||||
}
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
|
|
|
@ -79,6 +79,11 @@ namespace Microsoft.Net.Http.Server
|
|||
complete = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
server.SendError(asyncResult._nativeRequestContext.RequestId, HttpStatusCode.BadRequest);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (stoleBlob)
|
||||
|
|
|
@ -318,7 +318,7 @@ namespace Microsoft.Net.Http.Server
|
|||
return true;
|
||||
}
|
||||
|
||||
private unsafe void SendError(ulong requestId, HttpStatusCode httpStatusCode, IList<string> authChallenges)
|
||||
internal unsafe void SendError(ulong requestId, HttpStatusCode httpStatusCode, IList<string> authChallenges = null)
|
||||
{
|
||||
HttpApi.HTTP_RESPONSE_V2 httpResponse = new HttpApi.HTTP_RESPONSE_V2();
|
||||
httpResponse.Response_V1.Version = new HttpApi.HTTP_VERSION();
|
||||
|
|
Загрузка…
Ссылка в новой задаче