changeset 1537:f119ed48194b

cors support Ignore-this: 8f628d753d9770b3b9b22be1194f3307 darcs-hash:d277bc36a7c9d5a672bf326f43ece710ec75c6ca
author drewp <drewp@bigasterisk.com>
date Mon, 10 Feb 2020 00:03:11 -0800
parents 2e61abb70323
children 4857e22137c0
files service/environment/environment.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/service/environment/environment.py	Mon Feb 10 00:02:48 2020 -0800
+++ b/service/environment/environment.py	Mon Feb 10 00:03:11 2020 -0800
@@ -14,7 +14,7 @@
 from greplin.scales.cyclonehandler import StatsHandler
 from patchablegraph import PatchableGraph, CycloneGraphEventsHandler, CycloneGraphHandler
 from twilight import isWithinTwilight
-from logsetup import log, enableTwistedLog
+from standardservice.logsetup import log, verboseLogging
 
 from rdfdoc import Doc
 
@@ -25,6 +25,12 @@
                           scales.PmfStat('update'),
 )
 
+class CycloneGraphEventsHandlerWithCors(CycloneGraphEventsHandler):
+    def flush(self):
+        self.set_header("Access-Control-Allow-Origin", "*")
+        return CycloneGraphEventsHandler.flush(self)
+
+
 @STATS.update.time()
 def update(masterGraph):
     stmt = lambda s, p, o: masterGraph.patchObject(ROOM.environment, s, p, o)