Skip to content

Commit

Permalink
Add a content type and content length to this response. If not specif…
Browse files Browse the repository at this point in the history
…ied, browsers might interpret arbitrarily as plain text.
  • Loading branch information
Wayne Woodfield committed Nov 6, 2017
1 parent 8bfe16c commit 94eb327
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ public static String sendPost(HttpServletResponse response, String location, Map
}
html.append("</form>\n</body>\n</html>");
if (!stay) {
response.setContentType("text/html;charset=UTF-8");
response.setContentLength(html.toString().getBytes("UTF-8").length);
response.getWriter().write(html.toString());
}
return html.toString();
Expand Down

0 comments on commit 94eb327

Please sign in to comment.