fix(endpoints/api): return empty 204 resp
Return an empty body on API requests with status code 204, which means "No content". Incorrect 'Deleted' responses were being returned after successful DELETE operations despite the "No Content" definition of 204.
This commit is contained in:
parent
fde81c1b58
commit
43aed7c6f4
11 changed files with 22 additions and 22 deletions
|
@ -421,7 +421,7 @@ class User(ApiResource):
|
|||
abort(404)
|
||||
|
||||
model.user.delete_user(get_authenticated_user(), all_queues)
|
||||
return 'Deleted', 204
|
||||
return '', 204
|
||||
|
||||
|
||||
@resource('/v1/user/private')
|
||||
|
@ -873,7 +873,7 @@ class UserAuthorization(ApiResource):
|
|||
raise NotFound()
|
||||
|
||||
access_token.delete_instance(recursive=True, delete_nullable=True)
|
||||
return 'Deleted', 204
|
||||
return '', 204
|
||||
|
||||
@resource('/v1/user/starred')
|
||||
class StarredRepositoryList(ApiResource):
|
||||
|
@ -956,7 +956,7 @@ class StarredRepository(RepositoryParamResource):
|
|||
|
||||
if repo:
|
||||
model.repository.unstar_repository(user, repo)
|
||||
return 'Deleted', 204
|
||||
return '', 204
|
||||
|
||||
|
||||
@resource('/v1/users/<username>')
|
||||
|
|
Reference in a new issue