toc_depth: 2
---
+## 0.39.0 (September 23, 2024)
+
+#### Added
+
+* Add support for [HTTP Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests) to
+ `FileResponse` [#2697](https://github.com/encode/starlette/pull/2697).
+
## 0.38.6 (September 22, 2024)
#### Fixed
await response(scope, receive, send)
```
+File responses also supports [HTTP range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests).
+
+The `Accept-Ranges: bytes` header will be included in the response if the file exists. For now, only the `bytes`
+range unit is supported.
+
+If the request includes a `Range` header, and the file exists, the response will be a `206 Partial Content` response
+with the requested range of bytes. If the range is invalid, the response will be a `416 Range Not Satisfiable` response.
+
## Third party responses
#### [EventSourceResponse](https://github.com/sysid/sse-starlette)
A response class that implements [Server-Sent Events](https://html.spec.whatwg.org/multipage/server-sent-events.html). It enables event streaming from the server to the client without the complexity of websockets.
-
-#### [baize.asgi.FileResponse](https://baize.aber.sh/asgi#fileresponse)
-
-As a smooth replacement for Starlette [`FileResponse`](https://www.starlette.io/responses/#fileresponse), it will automatically handle [Head method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) and [Range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests).
-__version__ = "0.38.6"
+__version__ = "0.39.0"
from functools import partial
from mimetypes import guess_type
from random import choices as random_choices
-from typing import Mapping
from urllib.parse import quote
import anyio
self,
path: str | os.PathLike[str],
status_code: int = 200,
- headers: Mapping[str, str] | None = None,
+ headers: typing.Mapping[str, str] | None = None,
media_type: str | None = None,
background: BackgroundTask | None = None,
filename: str | None = None,