Commit 59bc493e authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 71eb7a7c d74ad883
......@@ -3743,7 +3743,8 @@ if settings.modules.http
#console.log(u.query.username, u.query.pass)
if u.pathname == '/api/getrooms'
if !settings.modules.http.public_roomlist and !auth.auth(u.query.username, u.query.pass, "get_rooms", "get_rooms")
pass_validated = auth.auth(u.query.username, u.query.pass, "get_rooms", "get_rooms")
if !settings.modules.http.public_roomlist and !pass_validated
response.writeHead(200)
response.end(addCallback(u.query.callback, '{"rooms":[{"roomid":"0","roomname":"密码错误","needpass":"true"}]}'))
else
......
......@@ -4829,11 +4829,12 @@
return callback + "( " + text + " );";
};
requestListener = function(request, response) {
var archive_args, archive_name, archive_process, check, death_room_found, duellog, error, filename, getpath, key, kick_room_found, len3, len4, len5, len6, len7, len8, m, n, o, oppo_pos, p, parseQueryString, player, q, r, ref3, ref4, replay, ret_keys, room, roomsjson, u, win_pos;
var archive_args, archive_name, archive_process, check, death_room_found, duellog, error, filename, getpath, key, kick_room_found, len3, len4, len5, len6, len7, len8, m, n, o, oppo_pos, p, parseQueryString, pass_validated, player, q, r, ref3, ref4, replay, ret_keys, room, roomsjson, u, win_pos;
parseQueryString = true;
u = url.parse(request.url, parseQueryString);
if (u.pathname === '/api/getrooms') {
if (!settings.modules.http.public_roomlist && !auth.auth(u.query.username, u.query.pass, "get_rooms", "get_rooms")) {
pass_validated = auth.auth(u.query.username, u.query.pass, "get_rooms", "get_rooms");
if (!settings.modules.http.public_roomlist && !pass_validated) {
response.writeHead(200);
response.end(addCallback(u.query.callback, '{"rooms":[{"roomid":"0","roomname":"密码错误","needpass":"true"}]}'));
} else {
......
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