Changeset

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
parents 9800:5c5117d41133
children 9806:b72d2f4153f7 9808:00d210deea28
files plugins/mod_websocket.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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);