Verified Commit ec908b4a authored by Chocobozzz's avatar Chocobozzz
Browse files

Fix nodeinfo endpoint

parent 99cb53fd
......@@ -161,7 +161,13 @@ async function generateNodeinfo (req: express.Request, res: express.Response) {
const { totalLocalVideoComments } = await VideoCommentModel.getStats()
const { totalUsers, totalMonthlyActiveUsers, totalHalfYearActiveUsers } = await UserModel.getStats()
if (req.params.version && (req.params.version === '2.0')) {
if (!req.params.version || req.params.version !== '2.0') {
return res.fail({
status: HttpStatusCode.NOT_FOUND_404,
message: 'Nodeinfo schema version not handled'
})
}
const json = {
version: '2.0',
software: {
......@@ -289,15 +295,10 @@ async function generateNodeinfo (req: express.Request, res: express.Response) {
}
}
} as HttpNodeinfoDiasporaSoftwareNsSchema20
res.contentType('application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.0#"')
.send(json)
.end()
}
return res.fail({
status: HttpStatusCode.NOT_FOUND_404,
message: 'Nodeinfo schema version not handled'
})
}
function getCup (req: express.Request, res: express.Response, next: express.NextFunction) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment