Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ jobs:
if: >-
needs.pre-setup.outputs.upstream-repository-id == github.repository_id
runs-on: ubuntu-latest
timeout-minutes: 12
timeout-minutes: 15
steps:
- name: Checkout project
uses: actions/checkout@v6
Expand Down Expand Up @@ -405,7 +405,7 @@ jobs:
uses: CodSpeedHQ/action@v4
with:
mode: instrumentation
run: python -Im pytest --no-cov -vvvvv --codspeed
run: python -Im pytest --no-cov -vvvvv --codspeed --durations=30


cython-coverage:
Expand Down
2 changes: 2 additions & 0 deletions CHANGES/12321.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added ``cdef`` type declarations and inlined the upgrade check in the HTTP parser
-- by :user:`bdraco`.
2 changes: 2 additions & 0 deletions CHANGES/12561.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Bumped the benchmark CI job timeout from 12 to 15 minutes to prevent
spurious failures on slower runners -- by :user:`aiolibsbot`.
1 change: 1 addition & 0 deletions CHANGES/12562.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added ``--durations=30`` to the benchmark CI run so the slowest tests are reported when the job hits its timeout -- by :user:`aiolibsbot`.
4 changes: 4 additions & 0 deletions CHANGES/12571.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fixed two flakey ``test_middleware_uses_session_avoids_recursion_with_*`` tests
that hard coded ``localhost`` in the inner middleware request; they now target
the bound server URL so happy eyeballs cannot pick an unbound address on
Windows runners -- by :user:`bdraco`.
6 changes: 4 additions & 2 deletions aiohttp/_http_parser.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ cdef class HttpParser:
self._has_value = True

cdef _on_headers_complete(self):
cdef str h_upg
cdef str enc

self._process_header()

http_version = self.http_version()
Expand All @@ -471,8 +474,7 @@ cdef class HttpParser:
if http_version == HttpVersion11 and hdrs.HOST not in headers:
raise BadHttpMessage("Missing 'Host' header in request.")
h_upg = headers.get("upgrade", "")
allowed = upgrade and h_upg.isascii() and h_upg.lower() in ALLOWED_UPGRADES
if allowed or self._cparser.method == cparser.HTTP_CONNECT:
if (upgrade and h_upg.isascii() and h_upg.lower() in ALLOWED_UPGRADES) or self._cparser.method == cparser.HTTP_CONNECT:
self._upgraded = True
else:
if upgrade and self._cparser.status_code == 101:
Expand Down
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Indices
infos
initializer
inline
inlined
intaking
io
IoT
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ async def log_middleware(
if request.url.path != "/log":
# Use the session from the request to make the logging call
async with request.session.post(
f"http://localhost:{log_server.port}/log",
log_server.make_url("/log"),
json={"method": str(request.method), "url": str(request.url)},
) as resp:
assert resp.status == 200
Expand Down Expand Up @@ -1023,7 +1023,7 @@ async def log_middleware(
# Use the session from the request to make the logging call
# Disable middleware to avoid infinite recursion
async with request.session.post(
f"http://localhost:{log_server.port}/log",
log_server.make_url("/log"),
json={"method": str(request.method), "url": str(request.url)},
middlewares=(), # This prevents infinite recursion
) as resp:
Expand Down
Loading