Skip to content

Commit

Permalink
Issue #6497 - add warnings for alias checker deprecations
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Oct 15, 2021
1 parent 2426b34 commit 4682e63
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -3041,6 +3041,11 @@ public interface AliasCheck
@Deprecated
public static class ApproveAliases implements AliasCheck
{
public ApproveAliases()
{
LOG.warn("ApproveAliases is deprecated");
}

@Override
public boolean check(String pathInContext, Resource resource)
{
Expand Down

0 comments on commit 4682e63

Please sign in to comment.