BinaryResult: Use Charset for setCharacterEncoding
Instead of using a String which is then converted to a Charset, use the Charset directly. Change-Id: I4e481286d5554b0f550c68992c266c06a9239340
This commit is contained in:
@@ -669,7 +669,7 @@ public class RestApiServlet extends HttpServlet {
|
||||
w.flush();
|
||||
replyBinaryResult(req, res, asBinaryResult(buf)
|
||||
.setContentType(JSON_TYPE)
|
||||
.setCharacterEncoding(UTF_8.name()));
|
||||
.setCharacterEncoding(UTF_8));
|
||||
}
|
||||
|
||||
private static Gson newGson(Multimap<String, String> config,
|
||||
@@ -791,7 +791,7 @@ public class RestApiServlet extends HttpServlet {
|
||||
res.setHeader("X-FYI-Content-Type", src.getContentType());
|
||||
return asBinaryResult(buf)
|
||||
.setContentType(JSON_TYPE)
|
||||
.setCharacterEncoding(UTF_8.name());
|
||||
.setCharacterEncoding(UTF_8);
|
||||
}
|
||||
|
||||
private static BinaryResult stackBase64(HttpServletResponse res,
|
||||
@@ -819,7 +819,7 @@ public class RestApiServlet extends HttpServlet {
|
||||
}
|
||||
res.setHeader("X-FYI-Content-Encoding", "base64");
|
||||
res.setHeader("X-FYI-Content-Type", src.getContentType());
|
||||
return b64.setContentType("text/plain").setCharacterEncoding(ISO_8859_1.name());
|
||||
return b64.setContentType("text/plain").setCharacterEncoding(ISO_8859_1);
|
||||
}
|
||||
|
||||
private static BinaryResult stackGzip(HttpServletResponse res,
|
||||
|
||||
Reference in New Issue
Block a user