Skip to content

Commit 129ad5d

Browse files
author
Evan Cordell
committed
fix(controller): change api logs response to 204 when no logs
The controller previously responded with a 404 (Not Found) when there were no logs available, it now returns a 204 (No Content). closes #990
1 parent 2aa99a6 commit 129ad5d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

controller/api/tests/test_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_app_actions(self):
7979
os.remove(path)
8080
url = '/api/apps/{app_id}/logs'.format(**locals())
8181
response = self.client.post(url)
82-
self.assertEqual(response.status_code, 404)
82+
self.assertEqual(response.status_code, 204)
8383
self.assertEqual(response.data, 'No logs for {}'.format(app_id))
8484
# write out some fake log data and try again
8585
with open(path, 'w') as f:

controller/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def logs(self, request, **kwargs):
299299
logs = app.logs()
300300
except EnvironmentError:
301301
return Response("No logs for {}".format(app.id),
302-
status=status.HTTP_404_NOT_FOUND,
302+
status=status.HTTP_204_NO_CONTENT,
303303
content_type='text/plain')
304304
return Response(logs, status=status.HTTP_200_OK,
305305
content_type='text/plain')

0 commit comments

Comments
 (0)