Compare commits
1 commit
develop
...
acid-chick
Author | SHA1 | Date | |
---|---|---|---|
|
631ddc0efd |
1 changed files with 13 additions and 0 deletions
|
@ -24,6 +24,9 @@ const jrd = 'application/jrd+json';
|
||||||
const xrd = 'application/xrd+xml';
|
const xrd = 'application/xrd+xml';
|
||||||
|
|
||||||
router.get('/.well-known/host-meta', async ctx => {
|
router.get('/.well-known/host-meta', async ctx => {
|
||||||
|
ctx.set('Access-Control-Allow-Methods', 'GET');
|
||||||
|
ctx.set('Access-Control-Allow-Origin', '*');
|
||||||
|
ctx.set('Access-Control-Max-Age', '31536000');
|
||||||
ctx.set('Content-Type', xrd);
|
ctx.set('Content-Type', xrd);
|
||||||
ctx.body = XRD({ element: 'Link', attributes: {
|
ctx.body = XRD({ element: 'Link', attributes: {
|
||||||
type: xrd,
|
type: xrd,
|
||||||
|
@ -32,6 +35,9 @@ router.get('/.well-known/host-meta', async ctx => {
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/.well-known/host-meta.json', async ctx => {
|
router.get('/.well-known/host-meta.json', async ctx => {
|
||||||
|
ctx.set('Access-Control-Allow-Methods', 'GET');
|
||||||
|
ctx.set('Access-Control-Allow-Origin', '*');
|
||||||
|
ctx.set('Access-Control-Max-Age', '31536000');
|
||||||
ctx.set('Content-Type', jrd);
|
ctx.set('Content-Type', jrd);
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
links: [{
|
links: [{
|
||||||
|
@ -43,10 +49,17 @@ router.get('/.well-known/host-meta.json', async ctx => {
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/.well-known/nodeinfo', async ctx => {
|
router.get('/.well-known/nodeinfo', async ctx => {
|
||||||
|
ctx.set('Access-Control-Allow-Methods', 'GET');
|
||||||
|
ctx.set('Access-Control-Allow-Origin', '*');
|
||||||
|
ctx.set('Access-Control-Max-Age', '31536000');
|
||||||
ctx.body = { links };
|
ctx.body = { links };
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get(webFingerPath, async ctx => {
|
router.get(webFingerPath, async ctx => {
|
||||||
|
ctx.set('Access-Control-Allow-Methods', 'GET');
|
||||||
|
ctx.set('Access-Control-Allow-Origin', '*');
|
||||||
|
ctx.set('Access-Control-Max-Age', '31536000');
|
||||||
|
|
||||||
const fromId = (id: User['id']): Record<string, any> => ({
|
const fromId = (id: User['id']): Record<string, any> => ({
|
||||||
id,
|
id,
|
||||||
host: null
|
host: null
|
||||||
|
|
Loading…
Reference in a new issue