Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion routes/showProductReviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function productReviews () {

// Measure how long the query takes, to check if there was a nosql dos attack
const t0 = new Date().getTime()
db.reviews.find({ $where: 'this.product == ' + id }).then((reviews: Review[]) => {
db.reviews.find({ product: { $eq: id } }).then((reviews: Review[]) => {
const t1 = new Date().getTime()
challengeUtils.solveIf(challenges.noSqlCommandChallenge, () => { return (t1 - t0) > 2000 })
const user = security.authenticatedUsers.from(req)
Expand Down