Fix nodeinfo endpoint
This commit is contained in:
parent
99cb53fd5a
commit
ec908b4a07
1 changed files with 136 additions and 135 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue