mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
ChunkBasedFileResponse: Support Content-Length
This commit is contained in:
@@ -5,5 +5,7 @@ class ChunkBasedFileResponse(StreamingHttpResponse):
|
||||
block_size = 4096
|
||||
|
||||
def __init__(self, streaming_content=(), *args, **kwargs):
|
||||
filelike = streaming_content
|
||||
streaming_content = streaming_content.chunks(self.block_size)
|
||||
super().__init__(streaming_content, *args, **kwargs)
|
||||
self['Content-Length'] = filelike.size
|
||||
|
||||
Reference in New Issue
Block a user