From bbfd64457d2f7d9cc6c9b4bb76d34a974ec07393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 3 Apr 2025 12:57:49 -0400 Subject: [PATCH] fix: closes #13298, catch exceptions in webfinger and nodeinfo --- src/routes/well-known.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/well-known.js b/src/routes/well-known.js index 399668b679..5ea46c41f6 100644 --- a/src/routes/well-known.js +++ b/src/routes/well-known.js @@ -3,6 +3,7 @@ const nconf = require('nconf'); const meta = require('../meta'); const db = require('../database'); +const helpers = require('./helpers'); module.exports = function (app, middleware, controllers) { const url = nconf.get('url'); @@ -12,7 +13,7 @@ module.exports = function (app, middleware, controllers) { res.redirect('/me/edit/password'); }); - app.get('/.well-known/webfinger', controllers['well-known'].webfinger); + app.get('/.well-known/webfinger', helpers.tryRoute(controllers['well-known'].webfinger)); app.get('/.well-known/nodeinfo', (req, res) => { res.json({ @@ -25,7 +26,7 @@ module.exports = function (app, middleware, controllers) { }); }); - app.get('/nodeinfo/2.0(.json)?', async (req, res) => { + app.get('/nodeinfo/2.0(.json)?', helpers.tryRoute(async (req, res) => { const getDaysInMonth = (year, month) => new Date(year, month, 0).getDate(); function addMonths(input, months) { @@ -73,5 +74,5 @@ module.exports = function (app, middleware, controllers) { nodeDescription: meta.config.description || '', }, }); - }); + })); };