Skip to content

Commit 06addb9

Browse files
committed
Path Manipulation java test cases
1 parent 95e9b40 commit 06addb9

File tree

1 file changed

+0
-5
lines changed
  • Path Manipulation/while File Read/java/fileread.pathmanipulation/src/main/java/securecodingexamples/fileread/pathmanipulation

1 file changed

+0
-5
lines changed

Path Manipulation/while File Read/java/fileread.pathmanipulation/src/main/java/securecodingexamples/fileread/pathmanipulation/DownloadController.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ public ResponseEntity<?> downloadFile(@RequestParam(name = "filename", required
3939
try {
4040
logger.info("Download file method started");
4141

42-
if(filename.contains("..") || filename.contains("/") || filename.contains("\\")) {
43-
logger.warning("Invalid filename requested");
44-
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Invalid filename");
45-
}
46-
4742
if (filename==null || filename.isEmpty() || !isValidName(filename)) {
4843
logger.warning("Invalid filename requested");
4944
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Invalid filename");

0 commit comments

Comments
 (0)