disabled wsgi.file_wrapper because it returns 0 bytes

This commit is contained in:
Jenny Danzmayr 2023-12-21 22:19:54 +01:00
parent 5aa14ea93c
commit 9278b98add

View file

@ -181,7 +181,7 @@ def get_cache_package(request, filetype):
content_type = 'application/' + {'tar': 'x-tar', 'tar.gz': 'gzip', 'tar.xz': 'x-xz', 'tar.zst': 'zstd'}[filetype]
response = StreamingHttpResponse(FileWrapper(f), content_type=content_type)
response.file_to_stream = f # This causes django to use the wsgi.file_wrapper if provided by the wsgi server.
#response.file_to_stream = f # This causes django to use the wsgi.file_wrapper if provided by the wsgi server.
response['Content-Length'] = size
if content_disposition := content_disposition_header(False, filename):
response["Content-Disposition"] = content_disposition