Use a more relaxed AliasCheck for CI on Windows

ContextHandler.ApproveAliases has been deprecated. We tried to
replace it with AllowedResourceAliasChecker but it does not
behave in the same way and causes CI failures on Windows.
ContextHandler.ApproveAliases always returns true so we should
hardcode our own implementation that does the same.

Closes gh-30045
pull/30505/head
Andy Wilkinson 3 years ago
parent 34e436ef6e
commit 57f935faed

@ -16,7 +16,6 @@
package smoketest.jetty.jsp; package smoketest.jetty.jsp;
import org.eclipse.jetty.server.AllowedResourceAliasChecker;
import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandler;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -60,7 +59,7 @@ class SampleWebJspApplicationTests {
JettyServerCustomizer jettyServerCustomizer() { JettyServerCustomizer jettyServerCustomizer() {
return (server) -> { return (server) -> {
ContextHandler handler = (ContextHandler) server.getHandler(); ContextHandler handler = (ContextHandler) server.getHandler();
handler.addAliasCheck(new AllowedResourceAliasChecker(handler)); handler.addAliasCheck((path, resource) -> true);
}; };
} }

Loading…
Cancel
Save