mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Fix nodeinfo endpoint
This commit is contained in:
parent
99cb53fd5a
commit
ec908b4a07
@ -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,17 +295,12 @@ 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) {
|
||||
res.status(HttpStatusCode.I_AM_A_TEAPOT_418)
|
||||
res.setHeader('Accept-Additions', 'Non-Dairy;1,Sugar;1')
|
||||
|
Loading…
Reference in New Issue
Block a user