pippo icon indicating copy to clipboard operation
pippo copied to clipboard

Issue with servlet filter registration

Open whyicantusemyemailasusername opened this issue 6 years ago • 2 comments

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 avatar Nov 21 '18 20:11 mhagnumdw

@mhagnumdw I remember our discussion :smile:.

It will be nice to find a good solution, to mix regular routes/filters with websocket routes.

decebals avatar Nov 22 '18 19:11 decebals