Comparison

plugins/mod_bosh.lua @ 4447:57d7362a9312

mod_bosh: Fixed use of a private HTTP request property.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 09 Dec 2011 11:44:00 +0500
parent 4442:bc0a68cae236
child 4457:332a5d73e5b6
comparison
equal deleted inserted replaced
4446:d1d4d8c8a2a9 4447:57d7362a9312
56 end 56 end
57 57
58 local trusted_proxies = module:get_option_set("trusted_proxies", {"127.0.0.1"})._items; 58 local trusted_proxies = module:get_option_set("trusted_proxies", {"127.0.0.1"})._items;
59 59
60 local function get_ip_from_request(request) 60 local function get_ip_from_request(request)
61 local ip = request.handler:ip(); 61 local ip = request.conn:ip();
62 local forwarded_for = request.headers["x-forwarded-for"]; 62 local forwarded_for = request.headers["x-forwarded-for"];
63 if forwarded_for then 63 if forwarded_for then
64 forwarded_for = forwarded_for..", "..ip; 64 forwarded_for = forwarded_for..", "..ip;
65 for forwarded_ip in forwarded_for:gmatch("[^%s,]+") do 65 for forwarded_ip in forwarded_for:gmatch("[^%s,]+") do
66 if not trusted_proxies[forwarded_ip] then 66 if not trusted_proxies[forwarded_ip] then