Remove use of X-Guacamole-Error-Message header, return null rather than throwing exception when config not found.

This commit is contained in:
Michael Jumper
2012-03-24 22:48:29 -07:00
parent 0f2c1c01aa
commit 50d8e4c319
2 changed files with 2 additions and 3 deletions

View File

@@ -150,7 +150,6 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet {
* @throws IOException If an error occurs while sending the error. * @throws IOException If an error occurs while sending the error.
*/ */
private void failAuthentication(HttpServletResponse response) throws IOException { 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);
} }

View File

@@ -176,8 +176,8 @@ public class BasicGuacamoleTunnelServlet extends AuthenticatingHttpServlet {
// Get authorized config // Get authorized config
GuacamoleConfiguration config = configs.get(id); GuacamoleConfiguration config = configs.get(id);
if (config == null) { if (config == null) {
logger.error("Error retrieving authorized configuration id={}.", id); logger.error("Configuration id={} not found.", id);
throw new GuacamoleException("Unknown configuration ID."); return null;
} }
logger.info("Successful connection from {} to \"{}\".", request.getRemoteAddr(), id); logger.info("Successful connection from {} to \"{}\".", request.getRemoteAddr(), id);