Implement URL XSS attack

This commit is contained in:
2024-10-08 14:30:39 +02:00
parent 3dd7b1d4c6
commit 41a7cbc9da
19 changed files with 243 additions and 61 deletions

View File

@@ -20,4 +20,23 @@ exercises.get("/", (req: Request, res: Response) => {
).then(result => {
res.status(200).json(result)
})
})
exercises.post("/:groupNr/:exerciseNr/:state", (req: Request, res: Response) => {
console.log(req.params.groupNr)
ExerciseGroup.findOne({
where: { groupNr: req.params.groupNr }
})
.then(group => {
Exercise.findOne({
where: {
exerciseNr: req.params.exerciseNr,
exerciseGroupId: group.id
}
})
.then(exercise => {
exercise.update({ solved: req.params.state == "1"})
res.status(200).send()
})
})
})