Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #6497 - add warnings for alias checker deprecations #6998

Merged
merged 1 commit into from
Oct 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
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;
joakime marked this conversation as resolved.
Show resolved Hide resolved

// Only support PathResource alias checking
if (!(resource instanceof PathResource))
return false;
Expand Down
Original file line number Diff line number Diff line change
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