Skip to content

Commit

Permalink
Add a cache to must_be_empty_body (#9174)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Sep 18, 2024
1 parent d3c3c6a commit 98b363e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/9174.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved performance of web requests -- by :user:`bdraco`.
1 change: 1 addition & 0 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,7 @@ def parse_http_date(date_str: Optional[str]) -> Optional[datetime.datetime]:
return None


@functools.lru_cache
def must_be_empty_body(method: str, code: int) -> bool:
"""Check if a request must return an empty body."""
return (
Expand Down

0 comments on commit 98b363e

Please sign in to comment.