fix: missing function

This commit is contained in:
alex-sviridov 2025-09-29 16:49:26 +02:00
parent 96c5a51eac
commit 09ab781cd5

View File

@ -768,5 +768,32 @@ class MiscController {
currentDailyLogs: Logger.logManager.getMostRecentCurrentDailyLogs() 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() module.exports = new MiscController()