Skip to content

Commit 3c3fcfd

Browse files
committed
Return empty response on successful token revocation.
1 parent 5ed4f50 commit 3c3fcfd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

oauth2_provider/tests/test_token_revocation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def test_revoke_access_token(self):
5757
url = "{url}?{qs}".format(url=reverse('oauth2_provider:revoke-token'), qs=query_string)
5858
response = self.client.post(url)
5959
self.assertEqual(response.status_code, 200)
60+
self.assertEqual(response.content, b'')
6061
self.assertFalse(AccessToken.objects.filter(id=tok.id).exists())
6162

6263
def test_revoke_access_token_with_hint(self):

oauth2_provider/views/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class RevokeTokenView(CsrfExemptMixin, OAuthLibMixin, View):
168168

169169
def post(self, request, *args, **kwargs):
170170
url, headers, body, status = self.create_revocation_response(request)
171-
response = HttpResponse(content=body, status=status)
171+
response = HttpResponse(content=body or '', status=status)
172172

173173
for k, v in headers.items():
174174
response[k] = v

0 commit comments

Comments
 (0)