Skip to content

Commit

Permalink
Jetty 12.1.x fix aliascheckertests (#12412)
Browse files Browse the repository at this point in the history
* Re-enable alias checking tests, remove unused tests.
  • Loading branch information
janbartel authored Oct 29, 2024
1 parent 465e0ac commit 44768f3
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 441 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
import org.eclipse.jetty.http.HttpTester;
import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.SymlinkAllowedResourceAliasChecker;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.resource.ResourceFactory;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
Expand All @@ -44,7 +45,6 @@
import static org.hamcrest.Matchers.startsWith;
import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;

@Disabled // TODO
public class AllowSymLinkAliasCheckerTest
{
public static Stream<Arguments> params()
Expand Down Expand Up @@ -177,12 +177,12 @@ private void setupServer() throws Exception
fileResourceContext.setContextPath("/");
fileResourceContext.setAllowNullPathInContext(true);
fileResourceContext.setHandler(fileResourceHandler);
/* TODO
fileResourceContext.setBaseResource(new PathResource(rootPath));

fileResourceContext.setBaseResource(ResourceFactory.of(fileResourceContext).newResource(rootPath));

fileResourceContext.clearAliasChecks();
fileResourceContext.addAliasCheck(new SymlinkAllowedResourceAliasChecker(fileResourceContext));
*/

server.setHandler(fileResourceContext);
server.start();
}
Expand Down
Loading

0 comments on commit 44768f3

Please sign in to comment.