Package org.eclipse.jetty.server
Class TrailingSlashAliasChecker
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.TrailingSlashAliasChecker
- All Implemented Interfaces:
AliasCheck
,LifeCycle
This will approve an alias where the only difference is a trailing slash.
For example, a request for a file containing a trailing slash like /context/dir/index.html/
,
can be approved as an alias to the file /context/dir/index.html
which exists.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAlias
(String pathInContext, Resource resource) Check if an alias is allowed to be served.Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addEventListener, doStart, doStop, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop, toString
-
Constructor Details
-
TrailingSlashAliasChecker
public TrailingSlashAliasChecker()
-
-
Method Details
-
checkAlias
Description copied from interface:AliasCheck
Check if an alias is allowed to be served. If anyAliasCheck
returns true then the alias will be allowed to be served, therefore any alias checker should take things like theContextHandler.getProtectedTargets()
and Security Constraints into consideration before allowing a return a value of true.- Specified by:
checkAlias
in interfaceAliasCheck
- Parameters:
pathInContext
- The path the aliased resource was created for.resource
- The aliased resourced.- Returns:
- True if the resource is OK to be served.
-