Kaydet (Commit) a9aec115 authored tarafından Collin Anderson's avatar Collin Anderson Kaydeden (comit) Tim Graham

Closed files in FileResponse; refs #24072

üst e08318b4
......@@ -442,6 +442,8 @@ class FileResponse(StreamingHttpResponse):
if hasattr(value, 'read'):
self.file_to_stream = value
filelike = value
if hasattr(filelike, 'close'):
self._closable_objects.append(filelike)
value = iter(lambda: filelike.read(self.block_size), b'')
else:
self.file_to_stream = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment