mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: closes #13298, catch exceptions in webfinger and nodeinfo
This commit is contained in:
@@ -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 || '',
|
||||
},
|
||||
});
|
||||
});
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user