Software /
code /
prosody
Comparison
plugins/mod_bosh.lua @ 8182:048a83433295
mod_bosh: Add ::1 to the default trusted_proxies.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 16 Jul 2017 19:25:15 +0100 |
parent | 8097:e24263db3380 |
child | 8185:e89320b8a789 |
child | 8840:4a5ff09887a4 |
comparison
equal
deleted
inserted
replaced
8177:f52cdad171b0 | 8182:048a83433295 |
---|---|
46 local cross_domain = module:get_option("cross_domain_bosh", false); | 46 local cross_domain = module:get_option("cross_domain_bosh", false); |
47 | 47 |
48 if cross_domain == true then cross_domain = "*"; end | 48 if cross_domain == true then cross_domain = "*"; end |
49 if type(cross_domain) == "table" then cross_domain = table.concat(cross_domain, ", "); end | 49 if type(cross_domain) == "table" then cross_domain = table.concat(cross_domain, ", "); end |
50 | 50 |
51 local trusted_proxies = module:get_option_set("trusted_proxies", {"127.0.0.1"})._items; | 51 local trusted_proxies = module:get_option_set("trusted_proxies", { "127.0.0.1", "::1" })._items; |
52 | 52 |
53 local function get_ip_from_request(request) | 53 local function get_ip_from_request(request) |
54 local ip = request.conn:ip(); | 54 local ip = request.conn:ip(); |
55 local forwarded_for = request.headers.x_forwarded_for; | 55 local forwarded_for = request.headers.x_forwarded_for; |
56 if forwarded_for then | 56 if forwarded_for then |