Commit 036b6e3f authored by nanahira's avatar nanahira

small fix

parent 1c0d7067
...@@ -3778,15 +3778,13 @@ if true ...@@ -3778,15 +3778,13 @@ if true
response.writeHead(404) response.writeHead(404)
response.end("bad filename") response.end("bad filename")
return return
fs.readFile(settings.modules.tournament_mode.replay_path + filename, (error, buffer)-> try
if error buffer = await fs.promises.readFile(settings.modules.tournament_mode.replay_path + filename)
response.writeHead(404) response.writeHead(200, { "Content-Type": "application/octet-stream", "Content-Disposition": "attachment" })
response.end("未找到文件 " + filename) response.end(buffer)
else catch e
response.writeHead(200, { "Content-Type": "application/octet-stream", "Content-Disposition": "attachment" }) response.writeHead(404)
response.end(buffer) response.end("未找到文件 " + filename)
return
)
else if u.pathname == '/api/message' else if u.pathname == '/api/message'
#if !pass_validated #if !pass_validated
......
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