Skip to content

Commit

Permalink
#11594 add alias check to allow all context resources to be served, a…
Browse files Browse the repository at this point in the history
…s for the equivalent servlet tests

Signed-off-by: Ludovic Orban <[email protected]>
  • Loading branch information
lorban committed Apr 4, 2024
1 parent 6320839 commit 66c1c3b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.eclipse.jetty.http.content.ValidatingCachingHttpContentFactory;
import org.eclipse.jetty.http.content.VirtualHttpContentFactory;
import org.eclipse.jetty.logging.StacklessLogging;
import org.eclipse.jetty.server.AllowedResourceAliasChecker;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.LocalConnector;
Expand Down Expand Up @@ -2026,6 +2027,8 @@ public void testGetUtf8NfcFile() throws Exception
{
FS.ensureEmpty(docRoot);

_contextHandler.addAliasCheck(new AllowedResourceAliasChecker(_contextHandler));

// Create file with UTF-8 NFC format
String filename = "swedish-" + new String(StringUtil.fromHexString("C3A5"), UTF_8) + ".txt";
Files.writeString(docRoot.resolve(filename), "hi a-with-circle", UTF_8);
Expand Down Expand Up @@ -2073,6 +2076,8 @@ public void testGetUtf8NfdFile() throws Exception
{
FS.ensureEmpty(docRoot);

_contextHandler.addAliasCheck(new AllowedResourceAliasChecker(_contextHandler));

// Create file with UTF-8 NFD format
String filename = "swedish-a" + new String(StringUtil.fromHexString("CC8A"), UTF_8) + ".txt";
Files.writeString(docRoot.resolve(filename), "hi a-with-circle", UTF_8);
Expand Down

0 comments on commit 66c1c3b

Please sign in to comment.