]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/hostmeta.php
Merge remote-tracking branch 'origin/1.0.x' into 1.0.x
[quix0rs-gnu-social.git] / actions / hostmeta.php
index 331fc8a99941c3c4429bd95f1d537d45db0778a1..5caf1960cbb1ae2970071ba62ff5df916230dc88 100644 (file)
@@ -28,9 +28,9 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
+// @todo XXX: Add documentation.
 class HostMetaAction extends Action
 {
-
     /**
      * Is read only?
      *
@@ -59,7 +59,13 @@ class HostMetaAction extends Action
             Event::handle('EndHostMetaLinks', array(&$xrd->links));
         }
 
+        // Output Cross-Origin Resource Sharing (CORS) header
+        if (common_config('discovery', 'cors')) {
+            header('Access-Control-Allow-Origin: *');
+        }
+
         header('Content-type: application/xrd+xml');
+
         print $xrd->toXML();
     }
 }