Skip to content

Commit 88f4835

Browse files
committed
add support for ASGI pathsend extension
1 parent 6bfe9fe commit 88f4835

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

starlette/responses.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
337337
)
338338
if scope["method"].upper() == "HEAD":
339339
await send({"type": "http.response.body", "body": b"", "more_body": False})
340+
elif "http.response.pathsend" in scope["extensions"]:
341+
await send({"type": "http.response.pathsend", "path": str(self.path)})
340342
else:
341343
async with await anyio.open_file(self.path, mode="rb") as file:
342344
more_body = True

0 commit comments

Comments
 (0)