Remove use of X-Guacamole-Error-Message header, return null rather than throwing...
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 25 Mar 2012 05:48:29 +0000 (22:48 -0700)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 25 Mar 2012 05:48:29 +0000 (22:48 -0700)
src/main/java/net/sourceforge/guacamole/net/basic/AuthenticatingHttpServlet.java
src/main/java/net/sourceforge/guacamole/net/basic/BasicGuacamoleTunnelServlet.java

index b2aa8ff..e696986 100644 (file)
@@ -150,7 +150,6 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet {
      * @throws IOException If an error occurs while sending the error.
      */
     private void failAuthentication(HttpServletResponse response) throws IOException {
      * @throws IOException If an error occurs while sending the error.
      */
     private void failAuthentication(HttpServletResponse response) throws IOException {
-        response.setHeader("X-Guacamole-Error-Message", AUTH_ERROR_MESSAGE);
         response.sendError(HttpServletResponse.SC_FORBIDDEN);
     }
     
         response.sendError(HttpServletResponse.SC_FORBIDDEN);
     }
     
index 2962e50..a04f5e7 100644 (file)
@@ -176,8 +176,8 @@ public class BasicGuacamoleTunnelServlet extends AuthenticatingHttpServlet {
             // Get authorized config
             GuacamoleConfiguration config = configs.get(id);
             if (config == null) {
             // Get authorized config
             GuacamoleConfiguration config = configs.get(id);
             if (config == null) {
-                logger.error("Error retrieving authorized configuration id={}.", id);
-                throw new GuacamoleException("Unknown configuration ID.");
+                logger.error("Configuration id={} not found.", id);
+                return null;
             }
             
             logger.info("Successful connection from {} to \"{}\".", request.getRemoteAddr(), id);
             }
             
             logger.info("Successful connection from {} to \"{}\".", request.getRemoteAddr(), id);