From 0748451e88141526719edfbc511dc16882bd21e5 Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Mon, 22 Jan 2024 01:04:22 +0100 Subject: [PATCH 1/3] Bump version to 2.5.8 --- emmett/__version__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/emmett/__version__.py b/emmett/__version__.py index fbfaae44..2e6e020c 100644 --- a/emmett/__version__.py +++ b/emmett/__version__.py @@ -1 +1 @@ -__version__ = "2.5.7" +__version__ = "2.5.8" diff --git a/pyproject.toml b/pyproject.toml index 102f3df4..6fa917d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "emmett" [tool.poetry] name = "emmett" -version = "2.5.7" +version = "2.5.8" description = "The web framework for inventors" authors = ["Giovanni Barillari "] license = "BSD-3-Clause" From 2c5b6cae8814ec10b20297d209a8133eb99ef3ac Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Mon, 22 Jan 2024 01:09:44 +0100 Subject: [PATCH 2/3] Bump granian to 1.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6fa917d2..24c4949b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ emmett = "emmett.cli:main" [tool.poetry.dependencies] python = "^3.8" click = ">=6.0" -granian = "~0.7.0" +granian = "~1.0.0" emmett-crypto = "^0.5" pendulum = "~3.0.0" pyDAL = "17.3" From 86ed5add60870bce5c819fe97218c51ae3fe87e3 Mon Sep 17 00:00:00 2001 From: Giovanni Barillari Date: Mon, 22 Jan 2024 01:09:59 +0100 Subject: [PATCH 3/3] Add ASGI `pathsend` support --- emmett/http.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emmett/http.py b/emmett/http.py index d882b476..da44e28b 100644 --- a/emmett/http.py +++ b/emmett/http.py @@ -221,7 +221,13 @@ async def asgi(self, scope, send): return self._headers.update(self._get_stat_headers(stat_data)) await self._send_headers(send) - await self._send_body(send) + if 'http.response.pathsend' in scope['extensions']: + await send({ + 'type': 'http.response.pathsend', + 'path': str(self.file_path) + }) + else: + await self._send_body(send) except IOError as e: if e.errno == errno.EACCES: await HTTP(403).send(scope, send)