-
-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Labels
Milestone
Description
As suggested by @Kludex
ASGI protocol might take advantage of granian capability of directly serve files from a path, like already implemented in RSGI proto.response_file
.
This would require to open up a PR to https://github.com/django/asgiref adding the new extra, which might look like the following:
"scope": {
...
"extensions": {
"http.response.file_path": {},
},
}
With the above extra definition, a new event might be produced by ASGI applications, with the following keys:
type
(Unicode string): "http.response.file_path"file_path
(Unicode string): The string representation of the file path to serve (platform specific)
The ASGI application is still responsible to send the http.response.start
event with the relevant headers (eg: content-type
, content-length
, etc.)
Kludex