Skip to content

Middleware: use regular HttpResponse and log the suspicious operation #9366

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

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

humitos
Copy link
Member

@humitos humitos commented Jun 22, 2022

Do not use raise SuspiciousOperation here because that ends up into Sentry
marked as an error logged via logger django.security.SuspiciousOperation.

I prefer to use regular log.info for these situations so they end up in NewRelic
and we can parse them nicely. They are not application errors.

@humitos humitos requested a review from a team as a code owner June 22, 2022 08:59
@humitos humitos requested a review from ericholscher June 22, 2022 08:59
Do not use `raise SuspiciousOperation` here because that ends up into Sentry
marked as an error logged via logger `django.security.SuspiciousOperation`.

I prefer to use regular `log.info` for these situations so they end up in NewRelic
and we can parse them nicely. They are not application errors.
@humitos humitos force-pushed the humitos/null-character-middleware branch from 02fb18f to 55f4d11 Compare June 27, 2022 10:49
@humitos humitos merged commit 3adf24e into main Jun 27, 2022
@humitos humitos deleted the humitos/null-character-middleware branch June 27, 2022 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants