This commit is contained in:
alex-sviridov 2026-02-26 21:20:54 +02:00 committed by GitHub
commit ecac07d7d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 319 additions and 2 deletions

View file

@ -771,5 +771,32 @@ class MiscController {
currentDailyLogs: Logger.logManager.getMostRecentCurrentDailyLogs()
})
}
/**
* GET: /api/test-proxy-header
* Test proxy header endpoint
*
* @param {RequestWithUser} req
* @param {Response} res
*/
testProxyHeader(req, res) {
if (!req.user.isAdminOrUp) {
Logger.error(`[MiscController] Non-admin user "${req.user.username}" attempted to test proxy header`)
return res.sendStatus(403)
}
const headerName = req.query.headerName
if (!headerName) {
return res.status(400).json({ message: 'Header name is required' })
}
const headerValue = req.headers[headerName.toLowerCase()]
res.json({
headerFound: !!headerValue,
headerValue: headerValue || null,
headerName: headerName
})
}
}
module.exports = new MiscController()