Skip to content

django-oauth-toolkit tries to parse all requests' body #466

@sassanh

Description

@sassanh

I'm using django-oauth-toolkit with django-rest-framework, I wanna send a bulk create request to django-rest-framework something like:

curl -X POST 'http://localhost:8000/api/user/' -d '[{"firstname":"John","lastname":"Oliver"},{"firstname":"X","lastname":"Y"}]' -H 'content-type: application/json'

When I send this request it never reaches to django-rest-framework because django-oauth-toolkit is trying to parse that request while it's not even sent to /o/token/ and it expects the request body to be a dict not a list. django-oauth-toolit parses every request no matter what's the endpoint.

I created a PR for this issue, the PR ignores the request if it can't parse it as a json dict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions