Skip to content

Commit 63ed35e

Browse files
author
Bart Koelman
authored
Fixed: write content type on invalid Accept headers, to enable FireFox to render the response as json. (#903)
1 parent 5d38ea3 commit 63ed35e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ private static async Task<bool> ValidateAcceptHeaderAsync(HttpContext httpContex
140140

141141
private static async Task FlushResponseAsync(HttpResponse httpResponse, JsonSerializerSettings serializerSettings, Error error)
142142
{
143+
httpResponse.ContentType = HeaderConstants.MediaType;
143144
httpResponse.StatusCode = (int) error.StatusCode;
144145

145146
JsonSerializer serializer = JsonSerializer.CreateDefault(serializerSettings);

0 commit comments

Comments
 (0)