File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/java/org/commonwl/view/workflow Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 4343import java .io .IOException ;
4444import java .nio .file .Files ;
4545import java .nio .file .Path ;
46+ import java .nio .file .Paths ;
4647import java .util .ArrayList ;
4748import java .util .Calendar ;
4849import java .util .Date ;
@@ -213,7 +214,8 @@ public List<WorkflowOverview> getWorkflowsFromDirectory(GitDetails gitInfo) thro
213214
214215 Path localPath = repo .getRepository ().getWorkTree ().toPath ();
215216 Path pathToDirectory = localPath .resolve (gitInfo .getPath ()).normalize ().toAbsolutePath ();
216- if (pathToDirectory .toString ().equals ("/" )) {
217+ Path root = Paths .get ("/" ).toAbsolutePath ();
218+ if (pathToDirectory .equals (root )) {
217219 pathToDirectory = localPath ;
218220 } else if (!pathToDirectory .startsWith (localPath .normalize ().toAbsolutePath ())) {
219221 // Prevent path traversal attacks
You can’t perform that action at this time.
0 commit comments