KNOX-1391 - Fix IllegalStateException when accessing Admin UI
authorSandeep More <more@apache.org>
Thu, 19 Jul 2018 21:58:01 +0000 (17:58 -0400)
committerSandeep More <more@apache.org>
Thu, 19 Jul 2018 21:58:01 +0000 (17:58 -0400)
gateway-server/src/main/java/org/apache/knox/gateway/GatewayServlet.java

index 055496d..21aa29b 100644 (file)
@@ -168,8 +168,13 @@ public class GatewayServlet implements Servlet, Filter {
       if( f != null ) {
         try {
           f.doFilter( servletRequest, servletResponse );
-          //TODO: This should really happen naturally somehow as part of being a filter.  This way will cause problems eventually.
-          chain.doFilter( servletRequest, servletResponse );
+
+          /* if response is committed in case of SSO redirect no need to apply further filters */
+          if(!servletResponse.isCommitted()) {
+            //TODO: This should really happen naturally somehow as part of being a filter.  This way will cause problems eventually.
+            chain.doFilter( servletRequest, servletResponse );
+          }
+
         } catch( IOException e ) {
           LOG.failedToExecuteFilter( e );
           throw e;