Merge pull request #6998 from eclipse/jetty-10.0.x-6497-AliasCheckWarnings
Issue #6497 - add warnings for alias checker deprecations
This commit is contained in:
commit
2095fb06d6
|
@ -13,6 +13,7 @@
|
|||
|
||||
package org.eclipse.jetty.server;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
@ -46,9 +47,18 @@ public class SameFileAliasChecker implements AliasCheck
|
|||
{
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SameFileAliasChecker.class);
|
||||
|
||||
public SameFileAliasChecker()
|
||||
{
|
||||
LOG.warn("SameFileAliasChecker is deprecated");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean check(String pathInContext, Resource resource)
|
||||
{
|
||||
// Do not allow any file separation characters in the URI.
|
||||
if (File.separatorChar != '/' && pathInContext.indexOf(File.separatorChar) >= 0)
|
||||
return false;
|
||||
|
||||
// Only support PathResource alias checking
|
||||
if (!(resource instanceof PathResource))
|
||||
return false;
|
||||
|
|
|
@ -3041,6 +3041,11 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
|
|||
@Deprecated
|
||||
public static class ApproveAliases implements AliasCheck
|
||||
{
|
||||
public ApproveAliases()
|
||||
{
|
||||
LOG.warn("ApproveAliases is deprecated");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean check(String pathInContext, Resource resource)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue