Opened 6 years ago
Last modified 6 years ago
#30567 closed Cleanup/optimization
Start passing FileResponse.block_size to wsgi.file_wrapper — at Version 1
| Reported by: | Chris Jerdonek | Owned by: | nobody |
|---|---|---|---|
| Component: | HTTP handling | Version: | dev |
| Severity: | Normal | Keywords: | block_size, wsgi.file_wrapper, FileResponse, wsgi |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I noticed that Django's FileResponse class has a block_size attribute which can be customized by subclassing: https://github.com/django/django/blob/415e899dc46c2f8d667ff11d3e54eff759eaded4/django/http/response.py#L393
but it's not passed to wsgi.file_wrapper. Only the filelike object is passed:
response = environ['wsgi.file_wrapper'](response.file_to_stream)
Note:
See TracTickets
for help on using tickets.