mod_websocket: Allow per-host cross_domain_websocket, defaulting to the base URL of the current host

remotes/origin/0.11
Kim Alvefur 9 years ago
parent d1eb694c30
commit b151bd4d64
  1. 8
      plugins/mod_websocket.lua

@ -323,9 +323,13 @@ function module.add_host(module)
-- The 'Origin' consists of the base URL without path
url_components.path = nil;
local this_origin = url.build(url_components);
cross_domain:add(this_origin);
local local_cross_domain = module:get_option_set("cross_domain_websocket", { this_origin });
-- Don't add / remove something added by another host
-- This might be weird with random load order
local_cross_domain:exclude(cross_domain);
cross_domain:include(local_cross_domain);
function module.unload()
cross_domain:remove(this_origin);
cross_domain:exclude(local_cross_domain);
end
end
end

Loading…
Cancel
Save