Skip to content

Commit

Permalink
host-metaとnodeinfoのキャッシュなど Resolve #4952
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Apr 18, 2024
1 parent 3ecfc33 commit 6f0666e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/server/nodeinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const router = new Router();
const nodeinfo2_1path = '/nodeinfo/2.1';
const nodeinfo2_0path = '/nodeinfo/2.0';

export const links = [/* (awaiting release) {
export const links = [{
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1',
href: config.url + nodeinfo2_1path
}, */{
}, {
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0',
href: config.url + nodeinfo2_0path
}];
Expand Down
4 changes: 3 additions & 1 deletion src/server/well-known.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ router.get('/.well-known/host-meta', async ctx => {
if (config.disableFederation) ctx.throw(404);

ctx.set('Content-Type', xrd);
ctx.set('Cache-Control', 'public, max-age=86400');
ctx.body = XRD({ element: 'Link', attributes: {
rel: 'lrdd',
type: xrd,
Expand All @@ -38,6 +39,7 @@ router.get('/.well-known/host-meta.json', async ctx => {
if (config.disableFederation) ctx.throw(404);

ctx.set('Content-Type', jrd);
ctx.set('Cache-Control', 'public, max-age=86400');
ctx.body = {
links: [{
rel: 'lrdd',
Expand All @@ -49,7 +51,7 @@ router.get('/.well-known/host-meta.json', async ctx => {

router.get('/.well-known/nodeinfo', async ctx => {
if (config.disableFederation) ctx.throw(404);

ctx.set('Cache-Control', 'public, max-age=86400');
ctx.body = { links };
});

Expand Down

0 comments on commit 6f0666e

Please sign in to comment.