133fa70c by Ean Schuessler

Merge branch 'BF-8478' into 'master'

#8478 Add a new option for returning HTML

See merge request !1
2 parents e2475825 ac02c978
......@@ -492,6 +492,18 @@ public class DirectControlServlet extends HttpServlet {
setResponseNoCache();
if ("HTML".equals(outputHandler)) {
response.setContentType("text/html; charset=utf-8");
PrintWriter writer = response.getWriter();
String jsonStr = JSON.from(result).toString();
response.setContentLength(jsonStr.getBytes("UTF-8").length);
writer.write(jsonStr);
writer.flush();
writer.close();
}
if ("JSON".equals(outputHandler)) {
response.setContentType("application/x-json;charset=UTF-8");
......