GUAC-558: Send proper error when unable to connect due to lack of context.

This commit is contained in:
Michael Jumper
2014-03-21 19:35:04 -07:00
parent 28711720f7
commit 11b8e3673a

View File

@@ -32,8 +32,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import org.glyptodon.guacamole.GuacamoleClientException; import org.glyptodon.guacamole.GuacamoleClientException;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.GuacamoleResourceNotFoundException; import org.glyptodon.guacamole.GuacamoleUnauthorizedException;
import org.glyptodon.guacamole.GuacamoleSecurityException;
import org.glyptodon.guacamole.net.auth.AuthenticationProvider; import org.glyptodon.guacamole.net.auth.AuthenticationProvider;
import org.glyptodon.guacamole.net.auth.Credentials; import org.glyptodon.guacamole.net.auth.Credentials;
import org.glyptodon.guacamole.net.auth.UserContext; import org.glyptodon.guacamole.net.auth.UserContext;
@@ -331,7 +330,7 @@ public abstract class AuthenticatingHttpServlet extends HttpServlet {
// If no context, no authorizaton present // If no context, no authorizaton present
if (context == null) if (context == null)
throw new GuacamoleSecurityException("Not authenticated"); throw new GuacamoleUnauthorizedException("Not authenticated");
// Allow servlet to run now that authentication has been validated // Allow servlet to run now that authentication has been validated
authenticatedService(context, request, response); authenticatedService(context, request, response);