Merge branch '314' into unstable

This commit is contained in:
James Muehlner
2013-07-09 15:49:22 -07:00

View File

@@ -20,6 +20,7 @@ package net.sourceforge.guacamole.net.basic;
*/ */
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Collection; import java.util.Collection;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@@ -226,6 +227,15 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet {
@Override @Override
protected void service(HttpServletRequest request, HttpServletResponse response) protected void service(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException { throws IOException, ServletException {
// Set character encoding to UTF-8 if it's not already set
if(request.getCharacterEncoding() == null) {
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException exception) {
throw new ServletException(exception);
}
}
HttpSession httpSession = request.getSession(true); HttpSession httpSession = request.getSession(true);