API-25: Proper error for wrong content-type header
All checks were successful
Jenkins Production Deployment
All checks were successful
Jenkins Production Deployment
This commit is contained in:
parent
cae471105e
commit
94b53aff4c
|
@ -36,6 +36,12 @@ loginRouter.post('/:isDevCall', async (req: Request, res: Response) => {
|
||||||
username = (req.query.username ?? '').toString();
|
username = (req.query.username ?? '').toString();
|
||||||
email = (req.query.email ?? '').toString();
|
email = (req.query.email ?? '').toString();
|
||||||
password = (req.query.password ?? '').toString();
|
password = (req.query.password ?? '').toString();
|
||||||
|
} else {
|
||||||
|
res.status(400).send({
|
||||||
|
'status': 'WRONG_CONTENT_TYPE',
|
||||||
|
'message': 'The transmitted content-type is not supported'
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let userIP = req.socket.remoteAddress ?? '';
|
let userIP = req.socket.remoteAddress ?? '';
|
||||||
let deviceInfo = req.headers['user-agent'] ?? '';
|
let deviceInfo = req.headers['user-agent'] ?? '';
|
||||||
|
|
|
@ -42,6 +42,12 @@ registerRouter.post('/:isDevCall', async (req: Request, res: Response) => {
|
||||||
firstName = (req.query.firstName ?? '').toString();
|
firstName = (req.query.firstName ?? '').toString();
|
||||||
lastName = (req.query.lastName ?? '').toString();
|
lastName = (req.query.lastName ?? '').toString();
|
||||||
password = (req.query.password ?? '').toString();
|
password = (req.query.password ?? '').toString();
|
||||||
|
} else {
|
||||||
|
res.status(400).send({
|
||||||
|
'status': 'WRONG_CONTENT_TYPE',
|
||||||
|
'message': 'The transmitted content-type is not supported'
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let userIP = req.socket.remoteAddress ?? '';
|
let userIP = req.socket.remoteAddress ?? '';
|
||||||
let deviceInfo = req.headers['user-agent'] ?? '';
|
let deviceInfo = req.headers['user-agent'] ?? '';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user