diff mod_http_altconnect/mod_http_altconnect.lua @ 1325:b21236b6b8d8

Backed out changeset 853a382c9bd6
author Kim Alvefur <zash@zash.se>
date Fri, 28 Feb 2014 15:37:55 +0100
parents 853a382c9bd6
children 0a0bf87ccda6
line wrap: on
line diff
--- a/mod_http_altconnect/mod_http_altconnect.lua	Fri Feb 28 15:36:06 2014 +0100
+++ b/mod_http_altconnect/mod_http_altconnect.lua	Fri Feb 28 15:37:55 2014 +0100
@@ -6,20 +6,16 @@
 local json = require"util.json";
 local st = require"util.stanza";
 local array = require"util.array";
-local it = require"util.iterators";
 
 local host_modules = hosts[module.host].modules;
 
 local function get_supported()
-	local uris = array(it.values(module:get_host_items("alt-conn-method")));
-	if #uris == 0 then
-		-- COMPAT for with before item array was added
-		if host_modules["bosh"] then
-			uris:push({ rel = "urn:xmpp:alt-connections:xbosh", href = module:http_url("bosh", "/http-bind") });
-		end
-		if host_modules["websocket"] then
-			uris:push({ rel = "urn:xmpp:alt-connections:websocket", href = module:http_url("websocket", "xmpp-websocket"):gsub("^http", "ws") });
-		end
+	local uris = array();
+	if host_modules["bosh"] then
+		uris:push({ rel = "urn:xmpp:alt-connections:xbosh", href = module:http_url("bosh", "/http-bind") });
+	end
+	if host_modules["websocket"] then
+		uris:push({ rel = "urn:xmpp:alt-connections:websocket", href = module:http_url("websocket", "xmpp-websocket"):gsub("^http", "ws") });
 	end
 	return uris;
 end