Skip to content

Request body not available when sending integer #524

Closed
@OskarPersson

Description

@OskarPersson

I'm using sentry-sdk 0.12.3 together with Django 2.2.6 and Django Rest Framework 3.10.3. I have a reproducible error in one of my views which basically looks like this:

def create(self, request):
    foo = request.data.get('foo')

If I make the following request

curl -X POST -H "Content-Type: application/json" http://localhost:8000/foo/ -d '"bar"'

The expected issue is reported and the sentry displays the request body as "bar".

If I instead send an integer like this

curl -X POST -H "Content-Type: application/json" http://localhost:8000/foo/ -d '123'

then the issue is still reported but no body is displayed.

Here is what my settings looks like:

import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
    dsn='my_dsn',
    send_default_pii=True,
    integrations=[CeleryIntegration(), DjangoIntegration()],
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions