]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'refs/merge-requests/157' of git://gitorious.org/statusnet/mainline...
authorZach Copley <zach@status.net>
Thu, 7 Jul 2011 22:58:28 +0000 (15:58 -0700)
committerZach Copley <zach@status.net>
Thu, 7 Jul 2011 22:58:28 +0000 (15:58 -0700)
actions/hostmeta.php
actions/userxrd.php
config.php.sample
lib/default.php

index e921b5ad59d4473f17c4608d61d1f6bb88e96c08..4c9e9b8ae5cab2ce558f70975cab2e6b105961aa 100644 (file)
@@ -59,6 +59,10 @@ class HostMetaAction extends Action
             Event::handle('EndHostMetaLinks', array(&$xrd->links));
         }
 
+        global $config;
+        if($config['site']['cors'] === true){
+            header('Access-Control-Allow-Origin: *');
+        }
         header('Content-type: application/xrd+xml');
         print $xrd->toXML();
     }
index 1d888064d67f094af0625b78110ef17a270c2c6b..4ba7f91c7e0943cde39aa3ab1faa4241919ea356 100644 (file)
@@ -30,6 +30,10 @@ class UserxrdAction extends XrdAction
     function prepare($args)
     {
         parent::prepare($args);
+        global $config;
+        if($config['site']['cors'] === true){
+            header('Access-Control-Allow-Origin: *');
+        }
 
         $this->uri = $this->trimmed('uri');
         $this->uri = self::normalize($this->uri);
index 5378ad973d319ba42f7ae35e1bfaa9ce1a31f9d7..8ddac67417fd15abc83bf497ba848bbddc6e8b77 100644 (file)
@@ -40,6 +40,8 @@ $config['site']['path'] = 'statusnet';
 // $config['site']['inviteonly'] = true;
 // Make the site invisible to  non-logged-in users
 // $config['site']['private'] = true;
+// Allow Cross-Origin Resource Sharing
+// $config['site']['cors'] = true;
 
 // If your web server supports X-Sendfile (Apache with mod_xsendfile,
 // lighttpd, nginx), you can enable X-Sendfile support for better
index 4a7d6110c5c95c5c648becf63e5655e7cdb6c44a..51d62ed767de2ba735c8e8c83993076ce91d39cc 100644 (file)
@@ -61,6 +61,7 @@ $default =
               'textlimit' => 140,
               'indent' => true,
               'use_x_sendfile' => false,
+              'cors' => true,
               'notice' => null, // site wide notice text
               'build' => 1, // build number, for code-dependent cache
               'minify' => true, // true to use the minified versions of JS files; false to use orig files. Can aid during development