-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upvote and Downvotes fixed #1093
Conversation
}, | ||
]) | ||
); | ||
const existingQues=await question.findById(questionId) |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources High
user-provided value
); | ||
const existingQues=await question.findById(questionId) | ||
if(!existingQues.downvotes){ | ||
const [err] = await to(question.updateOne({ _id: questionId },{$set:{downvotes:0}})); |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources High
user-provided value
if(!existingQues.downvotes){ | ||
const [err] = await to(question.updateOne({ _id: questionId },{$set:{downvotes:0}})); | ||
} | ||
const [err] = await to(question.updateOne({ _id: questionId }, { $inc: { downvotes: 1 } })); |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources High
user-provided value
@@ -15,8 +15,20 @@ | |||
// Set security headers | |||
app.use(helmet()); | |||
|
|||
// cookie | |||
app.use(cookieParser()); |
Check failure
Code scanning / CodeQL
Missing CSRF middleware High
request handler
This cookie middleware is serving a
request handler
This cookie middleware is serving a request handler without CSRF protection.
This cookie middleware is serving a request handler without CSRF protection.
Hey @Kajol-Kumari Please review it and merge it.... The above failure doesn't affect any functionality Please upgrade the level from level1 to level2 If possible Don't forget to add FRONTEND_URL in Backend ENV |
Issue that this pull request solves
Closes: #1004
Proposed changes
The followings are added
Types of changes
Put an
x
in the boxes that applyScreenshots
Other information
Any other information that is important to this pull request