We should also accept requests which send the Content-Type header like that Content-Type: application/json; charset="UTF-8" instead of that Content-Type: application/json; charset=UTF-8.
We should investigate if the newer .NET versions (7 or 8) accept these headers and if yes check if we can use their solutions as a baseline.
We should also accept requests which send the
Content-Type
header like thatContent-Type: application/json; charset="UTF-8"
instead of thatContent-Type: application/json; charset=UTF-8
.We should investigate if the newer .NET versions (7 or 8) accept these headers and if yes check if we can use their solutions as a baseline.
Possible solution:
Create our own
EncodingProvider
that wraps the defaultEncodingProvider
and trims quotes"
and'
from the encoding name in theGetEncoding(string)
method. We can register thisEncodingProvider
usingEncoding.RegisterProvider(EncodingProvider)