Skip to content

Commit

Permalink
Removed workaround for dotnet/aspnetcore#32097
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Koelman committed Dec 3, 2021
1 parent f28364e commit 23e90c1
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using JsonApiDotNetCore.Serialization.Objects;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -130,8 +129,6 @@ private static async Task<bool> ValidateContentTypeHeaderAsync(string allowedCon
{
string? contentType = httpContext.Request.ContentType;

// ReSharper disable once ConditionIsAlwaysTrueOrFalse
// Justification: Workaround for https://github.com/dotnet/aspnetcore/issues/32097 (fixed in .NET 6)
if (contentType != null && contentType != allowedContentType)
{
await FlushResponseAsync(httpContext.Response, serializerOptions, new ErrorObject(HttpStatusCode.UnsupportedMediaType)
Expand Down

0 comments on commit 23e90c1

Please sign in to comment.