comparison mod_register_json/mod_register_json.lua @ 360:81528ffa0b76

mod_register_json: Typo fix.
author Marco Cirillo <maranda@lightwitch.org>
date Tue, 12 Apr 2011 19:13:16 +0000
parents 5d22ebcb9ec5
children 146496a3be78
comparison
equal deleted inserted replaced
359:5d22ebcb9ec5 360:81528ffa0b76
61 else 61 else
62 -- Various sanity checks. 62 -- Various sanity checks.
63 if req_body == nil then module:log("debug", "JSON data submitted for user registration by %s failed to Decode.", user); return http_response(400, "JSON Decoding failed."); end 63 if req_body == nil then module:log("debug", "JSON data submitted for user registration by %s failed to Decode.", user); return http_response(400, "JSON Decoding failed."); end
64 64
65 -- Checks for both Throttling/Whitelist and Blacklist (basically copycatted from prosody's register.lua code) 65 -- Checks for both Throttling/Whitelist and Blacklist (basically copycatted from prosody's register.lua code)
66 if blacklist[req_body["ip"]] then then module:log("warn", "Attempt of reg. submission to the JSON servlet from blacklisted address: %s", req_body["ip"]); return http_response(403, "The specified address is blacklisted, sorry sorry."); end 66 if blacklist[req_body["ip"]] then module:log("warn", "Attempt of reg. submission to the JSON servlet from blacklisted address: %s", req_body["ip"]); return http_response(403, "The specified address is blacklisted, sorry sorry."); end
67 if throttle_time and not whitelist[req_body["ip"]] then 67 if throttle_time and not whitelist[req_body["ip"]] then
68 if not recent_ips[req_body["ip"]] then 68 if not recent_ips[req_body["ip"]] then
69 recent_ips[req_body["ip"]] = { time = os_time(), count = 1 }; 69 recent_ips[req_body["ip"]] = { time = os_time(), count = 1 };
70 else 70 else
71 local ip = recent_ips[req_body["ip"]]; 71 local ip = recent_ips[req_body["ip"]];