Commit bba72cea authored by mercury233's avatar mercury233

fix download replay can download any file

parent 7099842b
......@@ -3511,7 +3511,7 @@ if settings.modules.http
return
else
getpath=u.pathname.split("/")
filename=decodeURIComponent(getpath.pop())
filename=path.basename(decodeURIComponent(getpath.pop()))
fs.readFile(settings.modules.tournament_mode.replay_path + filename, (error, buffer)->
if error
response.writeHead(404)
......
......@@ -4534,7 +4534,7 @@
return;
} else {
getpath = u.pathname.split("/");
filename = decodeURIComponent(getpath.pop());
filename = path.basename(decodeURIComponent(getpath.pop()));
fs.readFile(settings.modules.tournament_mode.replay_path + filename, function(error, buffer) {
if (error) {
response.writeHead(404);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment