changeset 1241:2380a5d71448

mod_pubsub_eventsource: Add CORS headers for cross-domain support
author Matthew Wild <mwild1@gmail.com>
date Mon, 02 Dec 2013 03:06:10 +0000
parents e0d97eb52ab8
children 4d1226220e58
files mod_pubsub_eventsource/mod_pubsub_eventsource.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pubsub_eventsource/mod_pubsub_eventsource.lua	Sun Dec 01 19:12:08 2013 +0000
+++ b/mod_pubsub_eventsource/mod_pubsub_eventsource.lua	Mon Dec 02 03:06:10 2013 +0000
@@ -24,6 +24,9 @@
 	response.conn:write(table.concat({
 		"HTTP/1.1 200 OK";
 		"Content-Type: text/event-stream";
+		"Access-Control-Allow-Origin: *";
+		"Access-Control-Allow-Methods: GET";
+		"Access-Control-Max-Age: 7200";
 		"";
 		"";	
 	}, "\r\n"));