Diff

plugins/mod_websocket.lua @ 9805:7bfc4269dc36 0.11

mod_websocket: Log an error if cross_domain_websocket = true is set in a VirtualHost section
author Kim Alvefur <zash@zash.se>
date Tue, 22 Jan 2019 10:41:00 +0100
parent 9800:5c5117d41133
child 9806:b72d2f4153f7
child 10092:4b3c129e96f2
line wrap: on
line diff
--- a/plugins/mod_websocket.lua	Fri Jan 18 18:37:04 2019 +0100
+++ b/plugins/mod_websocket.lua	Tue Jan 22 10:41:00 2019 +0100
@@ -338,6 +338,11 @@
 		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);