You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Django requests only contain a stream for the request body and lazy load the request.body property if needed. This is very intuitive because you can handle tasks like a file upload without loading the entire file into the memory while keeping the possibility of easily accessing the request body.
AsgiRequests on the other hand load the entire body before the execution of the view and only offer a fake stream. Looking at this code, it seems perfectly doable to handle this exactly like Django does by default. There actually is a TODO for this feature in the code, but I think it was forgotten.
It was not forgotten, just not implemented yet, since it's a bit trickier to stream this successfully. It should, however, be implemented as you suggest, so I'll leave this open as an enhancement (as it would improve memory efficiency).
Django requests only contain a stream for the request body and lazy load the
request.body
property if needed. This is very intuitive because you can handle tasks like a file upload without loading the entire file into the memory while keeping the possibility of easily accessing the request body.AsgiRequests on the other hand load the entire body before the execution of the view and only offer a fake stream. Looking at this code, it seems perfectly doable to handle this exactly like Django does by default. There actually is a TODO for this feature in the code, but I think it was forgotten.
channels/channels/http.py
Lines 119 to 123 in 9c59938
The text was updated successfully, but these errors were encountered: