Skip to content

Commit

Permalink
small cleanup leveraging lilya 0.11.9
Browse files Browse the repository at this point in the history
Changes:

- a compatible default is now set in lilya we can remove it here
  • Loading branch information
devkral committed Dec 20, 2024
1 parent 21f1c4a commit a018e53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions esmerald/responses/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a018e53

Please sign in to comment.