Diff

plugins/mod_bosh.lua @ 5654:020c5cd6eb28

mod_bosh: Only return CORS headers if the Origin header is received, and CORS is enabled.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 07 Jun 2013 14:20:13 -0400
parent 5653:c7d10b1a64b1
child 5658:97c1c1bdd7bc
line wrap: on
line diff
--- a/plugins/mod_bosh.lua	Fri Jun 07 13:24:56 2013 -0400
+++ b/plugins/mod_bosh.lua	Fri Jun 07 14:20:13 2013 -0400
@@ -100,7 +100,9 @@
 end
 
 function handle_OPTIONS(event)
-	set_cross_domain_headers(event.response);
+	if cross_domain and event.request.headers.origin then
+		set_cross_domain_headers(event.response);
+	end
 	return "";
 end
 
@@ -118,7 +120,7 @@
 	local headers = response.headers;
 	headers.content_type = "text/xml; charset=utf-8";
 
-	if cross_domain then
+	if cross_domain and event.request.headers.origin then
 		set_cross_domain_headers(response);
 	end