Skip to content

Commit

Permalink
[PR #9174/98b363e4 backport][3.10] Add a cache to must_be_empty_body (#…
Browse files Browse the repository at this point in the history
…9190)

Co-authored-by: J. Nick Koston <[email protected]>
  • Loading branch information
patchback[bot] and bdraco authored Sep 18, 2024
1 parent 31c0753 commit 2770e61
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 @@ -973,6 +973,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 2770e61

Please sign in to comment.