Skip to content

None returned in successful token revocation body #158

@Geekfish

Description

@Geekfish

In oauthlib the revocation handler does the following:

def create_revocation_response(self, uri, http_method='POST', body=None, headers=None):
    # ... more stuff here ...
    response_body = request.callback + '()' if request.callback else None
    return {}, response_body, 200

Then the tuple response eventually reaches the wrapper view and an HttpResponse is created:

def post(self, request, *args, **kwargs):
    url, headers, body, status = self.create_revocation_response(request)
    response = HttpResponse(content=body, status=status)
    # ... more stuff here ...
    return response

The result in case of success, when there isn't a callback, is a response body that just contains None.

HTTP/1.1 200 OK
Content-Type: text/html

None

I think that the response body should be completely empty, None makes sense as a python type but it's meaningless for an api consumer that will just treat it as text.

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