mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
Ticket
This commit is contained in:
@@ -20,6 +20,7 @@ package net.sourceforge.guacamole.net.basic;
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Collection;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
@@ -226,6 +227,15 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void service(HttpServletRequest request, HttpServletResponse response)
|
||||
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);
|
||||
|
||||
|
@@ -92,6 +92,9 @@ public class List extends AuthenticatingHttpServlet {
|
||||
|
||||
// Write XML content type
|
||||
response.setHeader("Content-Type", "text/xml");
|
||||
|
||||
// Set encoding
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
||||
// Get connection directory
|
||||
Directory<String, Connection> directory = context.getConnectionDirectory();
|
||||
|
@@ -101,6 +101,9 @@ public class List extends AuthenticatingHttpServlet {
|
||||
|
||||
// Do not cache
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
|
||||
// Set encoding
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
||||
// Write actual XML
|
||||
try {
|
||||
|
@@ -199,6 +199,9 @@ public class List extends AuthenticatingHttpServlet {
|
||||
|
||||
// Do not cache
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
|
||||
// Set encoding
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
||||
// Map of all available protocols
|
||||
Map<String, ProtocolInfo> protocols = new HashMap<String, ProtocolInfo>();
|
||||
|
@@ -50,6 +50,9 @@ public class List extends AuthenticatingHttpServlet {
|
||||
|
||||
// Write XML content type
|
||||
response.setHeader("Content-Type", "text/xml");
|
||||
|
||||
// Set encoding
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
||||
// Write actual XML
|
||||
try {
|
||||
|
Reference in New Issue
Block a user