Set Content-Length directly, Django isn't guessing it

This commit is contained in:
Trenton H 2025-03-14 09:45:23 -07:00
parent a173f05d89
commit 12dc3c57b2

@ -2036,7 +2036,10 @@ class BulkDownloadView(GenericAPIView):
for document in documents:
strategy.add_document(document)
return FileResponse(zip_file.open("rb"), as_attachment=True)
response = FileResponse(zip_file.open("rb"), as_attachment=True)
response["Content-Length"] = zip_file.stat().st_size
return response
@extend_schema_view(**generate_object_with_permissions_schema(StoragePathSerializer))