add a CORS header to response HTTP headers on 9332
authorgoblin <github@uukgoblin.net>
Sat, 7 Jan 2012 15:23:39 +0000 (15:23 +0000)
committergoblin <github@uukgoblin.net>
Sat, 7 Jan 2012 15:23:39 +0000 (15:23 +0000)
This will allow cross-site requests from modern browsers to be able
to query p2pool for stats on the 9332 port.

p2pool/main.py

index f92af6e..9bc136c 100644 (file)
@@ -650,6 +650,7 @@ def main(args, net, datadir_path):
             
             def render_GET(self, request):
                 request.setHeader('Content-Type', self.mime_type)
+                request.setHeader('Access-Control-Allow-Origin', '*')
                 return self.func()
         
         web_root.putChild('rate', WebInterface(get_rate, 'application/json'))