SOLR-10031: Un-break the Windows build

This commit is contained in:
Jan Høydahl 2017-01-30 09:26:39 +01:00
parent 7bbb918467
commit aa5e048cbf
1 changed files with 2 additions and 1 deletions

View File

@ -1427,7 +1427,8 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
@Test
public void doTestIllegalFilePaths() throws Exception {
// Loop through the file=, cf=, tlogFile= params and prove that it throws exception for path traversal attempts
List<String> illegalFilenames = Arrays.asList("/foo/bar", "../dir/traversal", "illegal\rfile\nname\t");
String absFile = Paths.get("foo").toAbsolutePath().toString();
List<String> illegalFilenames = Arrays.asList(absFile, "../dir/traversal", "illegal\rfile\nname\t");
List<String> params = Arrays.asList(ReplicationHandler.FILE, ReplicationHandler.CONF_FILE_SHORT, ReplicationHandler.TLOG_FILE);
for (String param : params) {
for (String filename : illegalFilenames) {