mirror of
https://github.com/FoxxMD/multi-scrobbler.git
synced 2026-05-05 23:50:21 +00:00
feat(endpointlz): Add more logging for invalid routes
This commit is contained in:
parent
a5f6aaa7c0
commit
0aff56e891
1 changed files with 2 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ export const setupLZEndpointRoutes = (app: ExpressWithAsync, parentLogger: Logge
|
|||
// (in the event body parsing does not work or request is not POST/PATCH)
|
||||
webhookIngress.trackIngress(req, true);
|
||||
if (req.method !== 'POST') {
|
||||
logger.warn(`Expected request to this endpoint to be POST but got ${req.method} instead. URL: ${req.originalUrl}\nMake sure base URL path to MS endpoint is correct.`);
|
||||
return res.sendStatus(405);
|
||||
}
|
||||
next();
|
||||
|
|
@ -52,6 +53,7 @@ export const setupLZEndpointRoutes = (app: ExpressWithAsync, parentLogger: Logge
|
|||
});
|
||||
app.getAsync('/1/validate-token', async function (req, res) {
|
||||
//https://listenbrainz.readthedocs.io/en/latest/users/api/core.html#get--1-validate-token
|
||||
logger.info('Validated token');
|
||||
return res.status(200).json({
|
||||
code: 200,
|
||||
message: "Token valid.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue