From a018e5339bba019832476e5584396bc559d6ae45 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 20 Dec 2024 13:45:16 +0100 Subject: [PATCH] small cleanup leveraging lilya 0.11.9 Changes: - a compatible default is now set in lilya we can remove it here --- esmerald/responses/base.py | 4 +--- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/esmerald/responses/base.py b/esmerald/responses/base.py index 30422553..432df843 100644 --- a/esmerald/responses/base.py +++ b/esmerald/responses/base.py @@ -209,9 +209,7 @@ def make_response(self, content: Any) -> bytes | memoryview | str: return b'""' # keep it a serialized json object transform_kwargs.setdefault("post_transform_fn", None) - else: - # strip '"' - transform_kwargs.setdefault("post_transform_fn", lambda x: x.strip(b'"')) + # otherwise use default logic of lilya striping '"' with self.with_transform_kwargs(transform_kwargs): # if content is bytes it won't be transformed and # if None or NoReturn, return b"", this differs from the dedicated JSONResponses. diff --git a/pyproject.toml b/pyproject.toml index c03cddd4..b493f94c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ dependencies = [ "email-validator >=2.2.0,<3.0.0", "itsdangerous>=2.1.2,<3.0.0", "jinja2>=3.1.2,<4.0.0", - "lilya>=0.11.8", + "lilya>=0.11.9", "loguru>=0.7.0,<0.8.0", "pydantic>=2.10,<3.0.0", "pydantic-settings>=2.0.0,<3.0.0",