Commit 036b6e3f authored by nanahira's avatar nanahira

small fix

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