aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_websocket.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-01-22 10:41:00 +0100
committerKim Alvefur <zash@zash.se>2019-01-22 10:41:00 +0100
commitd69210201345ebe86c4a1471965b204d5044c3ec (patch)
tree69321d28ae37e8ba5eae92793e40d6bb87fd77f5 /plugins/mod_websocket.lua
parent62082d58327d6e17dd7864dcaea75c7cc747fe4b (diff)
downloadprosody-d69210201345ebe86c4a1471965b204d5044c3ec.tar.gz
prosody-d69210201345ebe86c4a1471965b204d5044c3ec.zip
mod_websocket: Log an error if cross_domain_websocket = true is set in a VirtualHost section
Diffstat (limited to 'plugins/mod_websocket.lua')
-rw-r--r--plugins/mod_websocket.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua
index 475cabfe..b4aba338 100644
--- a/plugins/mod_websocket.lua
+++ b/plugins/mod_websocket.lua
@@ -338,6 +338,11 @@ function module.add_host(module)
url_components.path = nil;
local this_origin = url.build(url_components);
local local_cross_domain = module:get_option_set("cross_domain_websocket", { this_origin });
+ if local_cross_domain:contains(true) then
+ module:log("error", "cross_domain_websocket = true only works in the global section");
+ return;
+ end
+
-- Don't add / remove something added by another host
-- This might be weird with random load order
local_cross_domain:exclude(cross_domain);