Skip to content

Commit

Permalink
Better encoding detection?
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Oct 12, 2024
1 parent c845616 commit e05863d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BUTR.CrashReport.Server.v13/JsonHandlerV13.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public async Task<IActionResult> UploadJsonAsync(ControllerBase controller, Canc
{
var tenant = byte.TryParse(controller.Request.Headers["Tenant"].ToString(), out var tenantId) ? tenantId : (byte) 1;

if (controller.Request.Headers.ContentEncoding.Any(x => x?.Equals("gzip,deflate", StringComparison.OrdinalIgnoreCase) == true))
if (controller.Request.Headers.ContentEncoding is ["gzip", "deflate"] or ["gzip,deflate"] or ["gzip, deflate"])
controller.Request.Body = await _gZipCompressor.DecompressAsync(controller.Request.Body, ct);
else
controller.Request.EnableBuffering();
Expand Down
2 changes: 1 addition & 1 deletion src/BUTR.CrashReport.Server.v14/JsonHandlerV14.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public async Task<IActionResult> UploadJsonAsync(ControllerBase controller, Canc
{
var tenant = byte.TryParse(controller.Request.Headers["Tenant"].ToString(), out var tenantId) ? tenantId : (byte) 1;

if (controller.Request.Headers.ContentEncoding.Any(x => x?.Equals("gzip,deflate", StringComparison.OrdinalIgnoreCase) == true))
if (controller.Request.Headers.ContentEncoding is ["gzip", "deflate"] or ["gzip,deflate"] or ["gzip, deflate"])
controller.Request.Body = await _gZipCompressor.DecompressAsync(controller.Request.Body, ct);
else
controller.Request.EnableBuffering();
Expand Down

0 comments on commit e05863d

Please sign in to comment.