HostMeta: pretty xml

This commit is contained in:
Alex Gleason 2023-07-09 18:51:44 -05:00
parent 19d7d1ae52
commit 8894bb5513
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 6 additions and 1 deletions

View File

@ -2,13 +2,18 @@ import { Conf } from '@/config.ts';
import type { AppController } from '@/app.ts';
/** https://datatracker.ietf.org/doc/html/rfc6415 */
const hostMetaController: AppController = (c) => {
const template = Conf.local('/.well-known/webfinger?resource={uri}');
c.header('content-type', 'application/xrd+xml');
return c.body(
`<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="${template}" type="application/xrd+xml" /></XRD>`,
`<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" template="${template}" type="application/xrd+xml" />
</XRD>
`,
);
};