Commit c62c6bb
committed
Added offset and count parameters to pathsend extension
This extends the http.response.pathsend extension to support partial
file sends by adding optional offset and count parameters, enabling
HTTP Range request support (RFC 7233) and efficient seeking in large
media files.
The parameters mirror the existing http.response.zerocopysend API:
- offset: byte position to start reading from (default: beginning)
- count: number of bytes to send (default: to end of file)
This allows ASGI frameworks to implement range requests without
handling file descriptors directly, offloading the operation to
the server while maintaining pathsend's simpler API.
Like zerocopysend, these parameters are optional for applications
(with sensible defaults), but servers that advertise pathsend support
are expected to handle all documented parameters including offset
and count.
The application remains responsible for setting appropriate headers
(Content-Range, Content-Length, Accept-Ranges) in the response.
Fixes #469
Related: emmett-framework/granian#1571 parent b7b15b2 commit c62c6bb
2 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
| |||
0 commit comments