Diff

plugins/mod_bosh.lua @ 5667:0bf1cdea43f6

mod_bosh: Reduce a little code.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 11 Jun 2013 12:55:47 -0400
parent 5660:df077bc8f019
child 5674:ebdbf4cf0b2f
line wrap: on
line diff
--- a/plugins/mod_bosh.lua	Mon Jun 10 14:37:02 2013 +0200
+++ b/plugins/mod_bosh.lua	Tue Jun 11 12:55:47 2013 -0400
@@ -37,6 +37,7 @@
 local consider_bosh_secure = module:get_option_boolean("consider_bosh_secure");
 local cross_domain = module:get_option("cross_domain_bosh", false);
 
+if cross_domain == true then cross_domain = "*"; end
 if type(cross_domain) == "table" then cross_domain = table.concat(cross_domain, ", "); end
 
 local trusted_proxies = module:get_option_set("trusted_proxies", {"127.0.0.1"})._items;
@@ -90,12 +91,7 @@
 	headers.access_control_allow_methods = "GET, POST, OPTIONS";
 	headers.access_control_allow_headers = "Content-Type";
 	headers.access_control_max_age = "7200";
-
-	if cross_domain == true then
-		headers.access_control_allow_origin = "*";
-	else
-		headers.access_control_allow_origin = cross_domain;
-	end
+	headers.access_control_allow_origin = cross_domain;
 	return response;
 end