]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/static.ts
Try to fix remote mastodon interactions
[github/Chocobozzz/PeerTube.git] / server / controllers / static.ts
index 05019fcc2139b9c7f9706b8b7e74652aa3e71d9b..73951be2d4b3ff0cc9a1283f276365a31754d827 100644 (file)
@@ -156,6 +156,19 @@ staticRouter.use('/.well-known/change-password',
   }
 )
 
+staticRouter.use('/.well-known/host-meta',
+  (_, res: express.Response) => {
+    res.type('application/xml');
+
+    const xml = '<?xml version="1.0" encoding="UTF-8"?>\n' +
+      '<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">\n' +
+      `  <Link rel="lrdd" type="application/xrd+xml" template="${WEBSERVER.URL}/.well-known/webfinger?resource={uri}"/>\n` +
+      '</XRD>'
+
+    res.send(xml).end()
+  }
+)
+
 // ---------------------------------------------------------------------------
 
 export {