mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-20 03:36:41 +00:00
Merge pull request #1137 from mwohlert/bugfix/check_appId_before_purging
Check if appId is a number before purging
This commit is contained in:
commit
d3a95ed748
@ -85,7 +85,13 @@ export function createV2Api(router: Router, applications: ApplicationManager) {
|
||||
'/v2/applications/:appId/purge',
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
const { force } = req.body;
|
||||
const { appId } = req.params;
|
||||
const appId = checkInt(req.params.appId);
|
||||
if (!appId) {
|
||||
return res.status(400).json({
|
||||
status: 'failed',
|
||||
message: 'Missing app id',
|
||||
});
|
||||
}
|
||||
|
||||
return doPurge(applications, appId, force)
|
||||
.then(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user