pippo
pippo copied to clipboard
Issue with servlet filter registration
Looks like filter registered via code taken from documentation ignores web socket requests. The code used is
ANY("/.*", routeContext -> {
log.info("Request for {} '{}'", routeContext.getRequestMethod(), routeContext.getRequestUri());
routeContext.next();
});
Registration via WebServerInitializer
doesn't work either, because ServletContext.addFilter
adds filter as is and after main pippo's filter.
The workaround for this is to use custom WebServer instance, with overriden protected PippoFilter createPippoFilter()
method.
It would be nice to have more straightforward method to register third-party servlet filters.
Related to: https://groups.google.com/d/topic/pippo-java/u2mNWBEUUOU/discussion
@mhagnumdw I remember our discussion :smile:.
It will be nice to find a good solution, to mix regular routes/filters with websocket routes.