Skip to content

Commit

Permalink
Message is not upgraded if Upgrade header is missing (aio-libs#7895)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored and Xiang Li committed Dec 4, 2023
1 parent 30ac983 commit 1961808
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 97 deletions.
1 change: 1 addition & 0 deletions CHANGES/7895.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed messages being reported as upgraded without an Upgrade header in Python parser. -- by :user:`Dreamsorcerer`
3 changes: 2 additions & 1 deletion aiohttp/http_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ def parse_headers(
close_conn = True
elif v == "keep-alive":
close_conn = False
elif v == "upgrade":
# https://www.rfc-editor.org/rfc/rfc9110.html#name-101-switching-protocols
elif v == "upgrade" and headers.get(hdrs.UPGRADE):
upgrade = True

# encoding
Expand Down
Loading

0 comments on commit 1961808

Please sign in to comment.