diff --git a/src/BUTR.CrashReportServer/Controllers/CrashUploadController.cs b/src/BUTR.CrashReportServer/Controllers/CrashUploadController.cs index 3f1f910..4d3cf20 100644 --- a/src/BUTR.CrashReportServer/Controllers/CrashUploadController.cs +++ b/src/BUTR.CrashReportServer/Controllers/CrashUploadController.cs @@ -1,5 +1,6 @@ using BUTR.CrashReport.Bannerlord.Parser; using BUTR.CrashReport.Models; +using BUTR.CrashReport.Renderer.Html; using BUTR.CrashReportServer.Contexts; using BUTR.CrashReportServer.Extensions; using BUTR.CrashReportServer.Models.Database; @@ -25,7 +26,6 @@ using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; -using BUTR.CrashReport.Renderer.Html; namespace BUTR.CrashReportServer.Controllers; @@ -116,7 +116,7 @@ private async Task UploadJsonAsync(CancellationToken ct) { if (Request.Headers.ContentEncoding.Any(x => x?.Equals("gzip,deflate", StringComparison.OrdinalIgnoreCase) == true)) Request.Body = await _gZipCompressor.DecompressAsync(Request.Body, ct); - + if (await HttpContext.Request.ReadFromJsonAsync(_jsonSerializerOptions, ct) is not { CrashReport: { } crashReport, LogSources: { } logSources }) return StatusCode(StatusCodes.Status500InternalServerError); @@ -138,7 +138,7 @@ private async Task UploadJsonAsync(CancellationToken ct) return Ok($"{_options.BaseUri}/{idEntity.FileId}"); } - + private static async Task CompressJson(string jsonModel) { using var compressedBase64Stream = new MemoryStream(); diff --git a/src/BUTR.CrashReportServer/Startup.cs b/src/BUTR.CrashReportServer/Startup.cs index d0f87ce..60db5ab 100644 --- a/src/BUTR.CrashReportServer/Startup.cs +++ b/src/BUTR.CrashReportServer/Startup.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Formatters; +using Microsoft.AspNetCore.ResponseCompression; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -23,7 +24,6 @@ using System.Security.Cryptography; using System.Text.Json; using System.Text.Json.Serialization; -using Microsoft.AspNetCore.ResponseCompression; namespace BUTR.CrashReportServer; @@ -131,7 +131,7 @@ public void ConfigureServices(IServiceCollection services) options.Level = CompressionLevel.SmallestSize; }); */ - + services.AddResponseCaching(); }