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 43
43
import java .io .IOException ;
44
44
import java .nio .file .Files ;
45
45
import java .nio .file .Path ;
46
+ import java .nio .file .Paths ;
46
47
import java .util .ArrayList ;
47
48
import java .util .Calendar ;
48
49
import java .util .Date ;
@@ -213,7 +214,8 @@ public List<WorkflowOverview> getWorkflowsFromDirectory(GitDetails gitInfo) thro
213
214
214
215
Path localPath = repo .getRepository ().getWorkTree ().toPath ();
215
216
Path pathToDirectory = localPath .resolve (gitInfo .getPath ()).normalize ().toAbsolutePath ();
216
- if (pathToDirectory .toString ().equals ("/" )) {
217
+ Path root = Paths .get ("/" ).toAbsolutePath ();
218
+ if (pathToDirectory .equals (root )) {
217
219
pathToDirectory = localPath ;
218
220
} else if (!pathToDirectory .startsWith (localPath .normalize ().toAbsolutePath ())) {
219
221
// Prevent path traversal attacks
You can’t perform that action at this time.
0 commit comments