mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Ticket
This commit is contained in:
@@ -117,6 +117,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider {
|
||||
public MySQLAuthenticationProvider() throws GuacamoleException {
|
||||
|
||||
final Properties myBatisProperties = new Properties();
|
||||
final Properties driverProperties = new Properties();
|
||||
|
||||
// Set the mysql properties for MyBatis.
|
||||
myBatisProperties.setProperty("mybatis.environment.id", "guacamole");
|
||||
@@ -126,6 +127,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider {
|
||||
myBatisProperties.setProperty("JDBC.username", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_USERNAME));
|
||||
myBatisProperties.setProperty("JDBC.password", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PASSWORD));
|
||||
myBatisProperties.setProperty("JDBC.autoCommit", "false");
|
||||
driverProperties.setProperty("characterEncoding","UTF-8");
|
||||
|
||||
// Set up Guice injector.
|
||||
injector = Guice.createInjector(
|
||||
@@ -135,6 +137,9 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider {
|
||||
@Override
|
||||
public void configure(Binder binder) {
|
||||
Names.bindProperties(binder, myBatisProperties);
|
||||
binder.bind(Properties.class)
|
||||
.annotatedWith(Names.named("JDBC.driverProperties"))
|
||||
.toInstance(driverProperties);
|
||||
}
|
||||
},
|
||||
|
||||
|
@@ -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;
|
||||
@@ -227,6 +228,15 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet {
|
||||
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);
|
||||
|
||||
// Try to get user context from session
|
||||
|
@@ -93,6 +93,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();
|
||||
|
||||
|
@@ -102,6 +102,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 {
|
||||
|
||||
|
@@ -200,6 +200,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>();
|
||||
|
||||
|
@@ -51,6 +51,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