Closed andersou closed 5 years ago
My solution:
public class SparkWebSocketFilter extends SparkFilter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if(((HttpServletRequest)request).getServletPath().equals("/websocket")){
chain.doFilter(request,response);
}else
super.doFilter(request, response, chain);
}
}
Hi! I'm trying to use Websockets in Spark by running Tomcat. But the Spark filter is blocking the route to the Websocket. One suggestion is to implement a parameter in the filter to add URL's that are excluded from the Spark filter.