When I return my object as JSON via JsonDataContractCodec OpenRasta sets Content-Type header to
application/json
but ignores charset part of content type.
When I use Chrome it sends GET request with folowing header:
Accept-Charset:windows-1251,utf-8;q=0.7,*;q=0.3
and all my utf-8 encoded json objects goes wrong.
I tried to override OperationResult with no luck. OpenRasta overwrites my header with codec's one.
Just found a way - inherit from JsonCoder and apply the
MediaTypeAttribute
:And register handler with:
But this way is very static:(