Class TrailingSlashAliasChecker

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.TrailingSlashAliasChecker
All Implemented Interfaces:
AliasCheck, LifeCycle

public class TrailingSlashAliasChecker extends AbstractLifeCycle implements AliasCheck

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.

  • Constructor Details

    • TrailingSlashAliasChecker

      public TrailingSlashAliasChecker()
  • Method Details

    • checkAlias

      public boolean checkAlias(String pathInContext, Resource resource)
      Description copied from interface: AliasCheck
      Check if an alias is allowed to be served. If any AliasCheck returns true then the alias will be allowed to be served, therefore any alias checker should take things like the ContextHandler.getProtectedTargets() and Security Constraints into consideration before allowing a return a value of true.
      Specified by:
      checkAlias in interface AliasCheck
      Parameters:
      pathInContext - The path the aliased resource was created for.
      resource - The aliased resourced.
      Returns:
      True if the resource is OK to be served.