Skip to content

fix: record statistics only after input validation in cowrie_session_…#1021

Merged
regulartim merged 1 commit intoGreedyBear-Project:developfrom
Sanchit2662:fix/cowrie-session-stats-before-validation
Mar 11, 2026
Merged

fix: record statistics only after input validation in cowrie_session_…#1021
regulartim merged 1 commit intoGreedyBear-Project:developfrom
Sanchit2662:fix/cowrie-session-stats-before-validation

Conversation

@Sanchit2662
Copy link
Copy Markdown
Contributor

Description

While going through cowrie_session_view.py I noticed that the Statistics record was being saved before any input validation so every invalid request (missing query param, bad format) was still getting counted in the dashboard stats. Moved the save to after the validation block so it only runs when the request is actually valid, consistent with how enrichment_view already handles it.

fixes #1014

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Checklist

Please complete this checklist carefully. It helps guide your contribution and lets maintainers verify that all requirements are met.

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the docs. If so, I also created a pull request in the docs repository.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

…view

Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
Copy link
Copy Markdown
Member

@regulartim regulartim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! :)

@regulartim regulartim merged commit 9dd5464 into GreedyBear-Project:develop Mar 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants