comparison mod_register_json/mod_register_json.lua @ 710:b0c0acccd7c4

mod_register_json: corrected trace.
author Marco Cirillo <maranda@lightwitch.org>
date Mon, 11 Jun 2012 00:35:26 +0000
parents aa3fbb33700d
children 9080b0898b6f
comparison
equal deleted inserted replaced
709:151743149f07 710:b0c0acccd7c4
85 recent_ips[req_body["ip"]] = os_time() 85 recent_ips[req_body["ip"]] = os_time()
86 else 86 else
87 if os_time() - recent_ips[req_body["ip"]] < throttle_time then 87 if os_time() - recent_ips[req_body["ip"]] < throttle_time then
88 recent_ips[req_body["ip"]] = os_time() 88 recent_ips[req_body["ip"]] = os_time()
89 module:log("warn", "JSON Registration request from %s has been throttled.", req_body["ip"]) 89 module:log("warn", "JSON Registration request from %s has been throttled.", req_body["ip"])
90 return http_response(503, "Woah... How many users you want to register..? Request throttled, wait a bit and try again.") 90 return http_response(event, 503, "Woah... How many users you want to register..? Request throttled, wait a bit and try again.")
91 end 91 end
92 recent_ips[req_body["ip"]] = os_time() 92 recent_ips[req_body["ip"]] = os_time()
93 end 93 end
94 end 94 end
95 95