Affects: 5.4.15
Does not work in MockMvc when FilterRegistrationBean
url pattern is *
.
See demo
Comment From: bclozel
Looking at PatternMappingFilterProxy, it seems that valid patterns are one of:
* prefix matching like /*
, /prefix/*
* suffix matching like /some/*.html
* strict matching like /sample
In your case, does /*
work in your sample application?
Comment From: Deycoesr
/*
can work
Comment From: Deycoesr
Tomcat filter support url pattern *
, see FilterMap.java#L134.
But PatternMappingFilterProxy not support *
Comment From: bclozel
I guess it would be nice to enhance a bit the Javadoc of this class. This is really replicating the behavior with Servlet mappings in general (see Servlet spec, "Specification of Mappings" section 12.2). In this case, "*"
is treated as an exact match.
I'm not sure we should copy Tomcat's behavior here as it's not consistent with Servlet mapping in general - even though changing the behavior here is unlikely to break existing applications.
Comment From: funky-eyes
I guess it would be nice to enhance a bit the Javadoc of this class. This is really replicating the behavior with Servlet mappings in general (see Servlet spec, "Specification of Mappings" section 12.2). In this case,
"*"
is treated as an exact match.I'm not sure we should copy Tomcat's behavior here as it's not consistent with Servlet mapping in general - even though changing the behavior here is unlikely to break existing applications.
I believe most business developers think * is equivalent to /*, can I mention a PR for that?
Comment From: Deycoesr
Undertow ServletPathMatches.java#L264 also support "*"
Comment From: bclozel
Closing in favor of #28041