Greg Wilkins
Greg Wilkins
The use of varargs for attribute value pairs is not the best, but less verbose than Map.of(...)
I've moved to 12.1.1 as it internal But it is a good idea and should not be dropped
@joakime you are able to set the charset and character encoding after `getOutputStream`, but only before the response is committed. It is still a strange/fragile order to do things in....
@chiqiu you don't have to set content-type before calling getOutputStream, but it is the more normal (less fragile) thing to do, as if you use the output stream after getting...
@chiqiu what happens if you run your application in the ee8 or ee9 environment? Actually if it is legacy code, how are you running a jetty-9 webapp on ee10? as...
I'm reopening this, as there should be a way to force jetty to emit the content-type with charset, even if just to support legacy clients.
@flozano Have you tried just adding an explicit `response.setHeader("Content-Type", "application/json;charset=utf8")`?
You can wrap the response in a filter and do that on setContentType. But you'd really want to detect old/legacy clients and only do that conditionally. If you do it...
@flozano I'm leaning towards being convinced... if the app calls `setContentType("application/json;charset=utf8")`, then that's the header we should send. Even if it is not correct and ignored by all modern clients....
Oh but I'm not convinced to add a charset to the content type if it is not passed explicitly. So in the following case: ```java response.setCharacterEncoding("utf-8"); response.setContentType("application/json"); ``` we would...