From 3d498c1386872057d92b4b70bd5eddc46c003088 Mon Sep 17 00:00:00 2001 From: Leshchev Artem Date: Mon, 8 Jul 2024 09:41:44 +0200 Subject: [PATCH] Change content type in ErrorsMiddleware (#17) Co-authored-by: Artem Leshchev --- .../ErrorsMiddleware.cs | 5 ++--- src/Directory.Packages.props | 16 ++++++++-------- src/__SolutionItems/CommonAssemblyInfo.cs | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs b/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs index d2a3fcd..4e48d44 100644 --- a/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs +++ b/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs @@ -1,6 +1,5 @@ using System.Net; using System.Net.Mime; -using System.Text.Json; using Bss.Platform.Api.Middlewares.Interfaces; @@ -28,10 +27,10 @@ public async Task Invoke(HttpContext context) private Task HandleExceptionAsync(HttpContext context, Exception exception) { - context.Response.ContentType = MediaTypeNames.Application.Json; + context.Response.ContentType = MediaTypeNames.Text.Plain; context.Response.StatusCode = (int)(serviceProvider.GetService()?.Resolve(exception) ?? HttpStatusCode.InternalServerError); - return context.Response.WriteAsync(JsonSerializer.Serialize(exception.GetBaseException().Message)); + return context.Response.WriteAsync(exception.GetBaseException().Message); } } diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 92cd64c..78158ac 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -5,24 +5,24 @@ - - - + + + - - + + - + - + - + diff --git a/src/__SolutionItems/CommonAssemblyInfo.cs b/src/__SolutionItems/CommonAssemblyInfo.cs index 82e9b12..b234f34 100644 --- a/src/__SolutionItems/CommonAssemblyInfo.cs +++ b/src/__SolutionItems/CommonAssemblyInfo.cs @@ -4,9 +4,9 @@ [assembly: AssemblyCompany("Luxoft")] [assembly: AssemblyCopyright("Copyright © Luxoft 2024")] -[assembly: AssemblyVersion("1.5.2.0")] -[assembly: AssemblyFileVersion("1.5.2.0")] -[assembly: AssemblyInformationalVersion("1.5.2.0")] +[assembly: AssemblyVersion("1.5.3.0")] +[assembly: AssemblyFileVersion("1.5.3.0")] +[assembly: AssemblyInformationalVersion("1.5.3.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")]