Skip to content

Commit

Permalink
Fix CONNECT always being treated as having an empty body
Browse files Browse the repository at this point in the history
CONNECT will only have an empty body on 200

fixes a mistake in aio-libs#7755
  • Loading branch information
bdraco committed Oct 31, 2023
1 parent 015f14c commit eb95e5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def method_must_be_empty_body(method: str) -> bool:
"""Check if a method must return an empty body."""
# https://datatracker.ietf.org/doc/html/rfc9112#section-6.3-2.1
# https://datatracker.ietf.org/doc/html/rfc9112#section-6.3-2.2
return method.upper() in (hdrs.METH_CONNECT, hdrs.METH_HEAD)
return method.upper() == hdrs.METH_HEAD


def status_code_must_be_empty_body(code: int) -> bool:
Expand Down

0 comments on commit eb95e5a

Please sign in to comment.