Comparison

mod_srvinjection/mod_srvinjection.lua @ 99:2d03350613c4

mod_srvinjection: Added support for resolving "localhost" and "127.0.0.1".
author Waqas Hussain <waqas20@gmail.com>
date Thu, 26 Nov 2009 20:23:20 +0500
parent 96:c1f4edf3bea7
child 336:e4d5a1d3ff44
comparison
equal deleted inserted replaced
98:a54cc7bca826 99:2d03350613c4
29 local mapping = map[host]; 29 local mapping = map[host];
30 if mapping then 30 if mapping then
31 handler(mapping); 31 handler(mapping);
32 return; 32 return;
33 end 33 end
34 elseif qtype == "A" and (qname == "localhost." or qname == "127.0.0.1.") then
35 handler({{ a = "127.0.0.1" }});
36 return;
34 end 37 end
35 return original_lookup(handler, qname, qtype, qclass); 38 return original_lookup(handler, qname, qtype, qclass);
36 end 39 end
37 40
38 function module.unload() 41 function module.unload()