Browse Source

default request handler path security patch

rekjn 5 years ago
parent
commit
de793b6383
1 changed files with 1 additions and 1 deletions
  1. 1 1
      index.js

+ 1 - 1
index.js

@@ -100,7 +100,7 @@ function getMimeType ( filepath )
 function createDefaultResponse ( request, response, requestData )
 {
 	let fullPath = './frontend' + requestData.path;
-	fullPath.replace ( /\.\./g, '' );
+	fullPath = fullPath.replace( /\.\.\//g, '' );
 	
 	if ( fs.existsSync ( fullPath ) && fs.lstatSync ( fullPath ).isDirectory ( ) )
 		fullPath = fullPath + 'index.html';