Skip to content

Commit f2d40f2

Browse files
committed
Remove reason phrase from HttpExceptionMiddleware
1 parent 05064cf commit f2d40f2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ namespace Boxed.AspNetCore.Middleware
22
{
33
using System.Threading.Tasks;
44
using Microsoft.AspNetCore.Http;
5-
using Microsoft.AspNetCore.Http.Features;
65
using Microsoft.Extensions.DependencyInjection;
76
using Microsoft.Extensions.Logging;
87

@@ -19,15 +18,11 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next)
1918
var factory = context.RequestServices.GetRequiredService<ILoggerFactory>();
2019
var logger = factory.CreateLogger<HttpExceptionMiddleware>();
2120
logger.LogInformation(
21+
httpException,
2222
"Executing HttpExceptionMiddleware, setting HTTP status code {0}.",
2323
httpException.StatusCode);
2424

2525
context.Response.StatusCode = httpException.StatusCode;
26-
if (httpException != null)
27-
{
28-
var responseFeature = context.Features.Get<IHttpResponseFeature>();
29-
responseFeature.ReasonPhrase = httpException.Message;
30-
}
3126
}
3227
}
3328
}

0 commit comments

Comments
 (0)