From 24e98cf02db15dd0ba0c6d092d013b93684c5822 Mon Sep 17 00:00:00 2001 From: bit Date: Thu, 8 Apr 2021 23:52:53 +0200 Subject: [PATCH] use 204 instead of 404 if chunk does not exist sending 404 is considered an error in many layers of the stack. using http status code 304 avoids those warnings/errors in the django backend and browser. 204 is the recommended response code according to https://github.com/23/resumable.js --- admin_async_upload/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_async_upload/views.py b/admin_async_upload/views.py index cf388d7..5cdf943 100644 --- a/admin_async_upload/views.py +++ b/admin_async_upload/views.py @@ -30,7 +30,7 @@ def post(self, request, *args, **kwargs): def get(self, request, *args, **kwargs): r = ResumableFile(self.model_upload_field, user=request.user, params=request.GET) if not r.chunk_exists: - return HttpResponse('chunk not found', status=404) + return HttpResponse('chunk not found', status=204) if r.is_complete: return HttpResponse(r.collect()) return HttpResponse('chunk exists')