Skip to content
Snippets Groups Projects
Commit b133f22d authored by Michiel de Jong's avatar Michiel de Jong
Browse files

move host-meta to JRD because I can't work out how to deal with ampersands in XRD

parent a95c1b80
Branches
No related tags found
No related merge requests found
<?php <?php
$hostMetaHeader = array( $hostMetaHeader = array(
'Access-Control-Allow-Origin' => '*', 'Access-Control-Allow-Origin' => '*',
'Content-Type' => 'application/xml+xrd' 'Content-Type' => 'application/json+jrd'
); );
$ownCloudDir = dirname($appsDir); $ownCloudDir = dirname($appsDir);
$docRoot = $_SERVER['DOCUMENT_ROOT']; $docRoot = $_SERVER['DOCUMENT_ROOT'];
...@@ -19,13 +19,7 @@ if(isset($_SERVER['HTTPS'])) { ...@@ -19,13 +19,7 @@ if(isset($_SERVER['HTTPS'])) {
$lrddTmpl .= '://' . $serverName . $webRoot . '/public.php?service=webfinger&q={uri}'; $lrddTmpl .= '://' . $serverName . $webRoot . '/public.php?service=webfinger&q={uri}';
$hostMetaPath = $docRoot . '/.well-known/host-meta'; $hostMetaPath = $docRoot . '/.well-known/host-meta';
$hostMetaDir = $docRoot . '/.well-known'; $hostMetaDir = $docRoot . '/.well-known';
$hostMetaContents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> $hostMetaContents = "{\"links\":[{\"rel\":\"lrdd\",\"template\":\"http://mich.oc/public.php?service=webfinger&q={uri}\"}]}";
<XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\" xmlns:hm=\"http://host-meta.net/xrd/1.0\">
<hm:Host xmlns=\"http://host-meta.net/xrd/1.0\">" . $serverName . "</hm:Host>
<Link rel=\"lrdd\" template=\"" . $lrddTmpl . "\">
<Title>Resource Descriptor</Title>
</Link>
</XRD>";
foreach($hostMetaHeader as $header => $value) { foreach($hostMetaHeader as $header => $value) {
header($header . ": " . $value); header($header . ": " . $value);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment