-
Notifications
You must be signed in to change notification settings - Fork 1
Hotfixes #110
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
Hotfixes #110
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ public async Task<IActionResult> AskQuestion([FromBody] CreateQuestionDto dto) | |
| } | ||
|
|
||
| [HttpGet("questions/{postId}")] | ||
| [AllowAnonymous] | ||
| public async Task<IActionResult> GetQuestionsForPost(string postId) | ||
|
Comment on lines
+24
to
25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing post visibility check for anonymous access
Tell me moreWhat is the issue?Making GetQuestionsForPost endpoint publicly accessible without validation could expose sensitive question data if the post itself is not meant to be public. Why this mattersAnonymous access to questions without checking post visibility permissions could lead to information disclosure of private or restricted content. Suggested change ∙ Feature PreviewAdd a visibility check before returning questions: [HttpGet("questions/{postId}")]
[AllowAnonymous]
public async Task<IActionResult> GetQuestionsForPost(string postId)
{
var post = await postService.GetPostAsync(postId);
if (!post.IsPublic)
{
return NotFound();
}
var questions = await qaService.GetQuestionsForPostAsync(postId);
return Ok(questions);
}Provide feedback to improve future suggestions💬 Looking for more details? Reply to this comment to chat with Korbit. |
||
| { | ||
| var questions = await qaService.GetQuestionsForPostAsync(postId); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent error message format
Tell me more
What is the issue?
The exception message is inconsistent with similar error messages in the file.
Why this matters
Inconsistent error messages make logs harder to parse and debug patterns harder to establish.
Suggested change ∙ Feature Preview
throw new NotFoundException("Answer not found");
Provide feedback to improve future suggestions
💬 Looking for more details? Reply to this comment to chat with Korbit.