Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x

This commit is contained in:
Joakim Erdfelt 2020-11-02 19:04:59 -06:00
commit a7ed2f072a
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 5 additions and 16 deletions

View File

@ -488,21 +488,8 @@ public class ServletHandler extends ScopedHandler
FilterChain chain = null;
// find the servlet
if (target.startsWith("/"))
{
if (servletHolder != null && _filterMappings != null && _filterMappings.length > 0)
chain = getFilterChain(baseRequest, target, servletHolder);
}
else
{
if (servletHolder != null)
{
if (_filterMappings != null && _filterMappings.length > 0)
{
chain = getFilterChain(baseRequest, null, servletHolder);
}
}
}
if (servletHolder != null && _filterMappings != null && _filterMappings.length > 0)
chain = getFilterChain(baseRequest, target.startsWith("/") ? target : null, servletHolder);
if (LOG.isDebugEnabled())
LOG.debug("chain={}", chain);
@ -561,6 +548,7 @@ public class ServletHandler extends ScopedHandler
private FilterChain getFilterChain(Request baseRequest, String pathInContext, ServletHolder servletHolder)
{
Objects.requireNonNull(servletHolder);
String key = pathInContext == null ? servletHolder.getName() : pathInContext;
int dispatch = FilterMapping.dispatch(baseRequest.getDispatcherType());
@ -576,7 +564,7 @@ public class ServletHandler extends ScopedHandler
// The mappings lists have been reversed to make this simple and fast.
FilterChain chain = null;
if (servletHolder != null && _filterNameMappings != null && !_filterNameMappings.isEmpty())
if (_filterNameMappings != null && !_filterNameMappings.isEmpty())
{
if (_wildFilterNameMappings != null)
for (FilterMapping mapping : _wildFilterNameMappings)
@ -1658,6 +1646,7 @@ public class ServletHandler extends ScopedHandler
ChainEnd(ServletHolder holder)
{
Objects.requireNonNull(holder);
_servletHolder = holder;
}