When running TestOAuth2Challenge we've noticed this strange behavior:
registering a servlet filter with any filter mapping associates the filter to any servlet path.
For instance, with the following contribution:
<extension target="org.nuxeo.runtime.server" point="filter"> <filter context="/"> <filter-name>NuxeoAuthenticationFilter</filter-name> <filter-class>org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter</filter-class> <display-name>Nuxeo Authentication Filter</display-name> <filter-mapping> <url-pattern>/authentication/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> </filter> </extension>
calling /bla/xxx goes through the Nuxeo Authentication Filter.
We would expect to only go through the filter for request paths matching the URL pattern defined in the filter mapping.
This is because of the following code, see NXP-2449:
filterMap.addServletName("*");
which sets matchAllServletNames = true in Tomcat's FilterMap class.
- is related to
-
NXP-24493 Use Tomcat instead of old Jetty 6 for tests
- Resolved