Releases: aio-libs/aiohttp
3.13.5
3.13.4
Features
-
Added
max_headersparameter to limit the number of headers that should be read from a response -- by :user:Dreamsorcerer.Related issues and pull requests on GitHub:
#11955. -
Added a
dns_cache_max_sizeparameter toTCPConnectorto limit the size of the cache -- by :user:Dreamsorcerer.Related issues and pull requests on GitHub:
#12106.
Bug fixes
-
Fixed server hanging indefinitely when chunked transfer encoding chunk-size
does not match actual data length. The server now raises
TransferEncodingErrorinstead of waiting forever for data that will
never arrive -- by :user:Fridayai700.Related issues and pull requests on GitHub:
#10596. -
Fixed access log timestamps ignoring daylight saving time (DST) changes. The
previous implementation used :py:data:time.timezonewhich is a constant and
does not reflect DST transitions -- by :user:nightcityblade.Related issues and pull requests on GitHub:
#11283. -
Fixed
RuntimeError: An event loop is runningerror when usingaiohttp.GunicornWebWorker
oraiohttp.GunicornUVLoopWebWorkeron Python >=3.14.
-- by :user:Tasssadar.Related issues and pull requests on GitHub:
#11701. -
Fixed :exc:
ValueErrorwhen creating a TLS connection withClientTimeout(total=0)by converting0toNonebefore passing tossl_handshake_timeoutin :py:meth:asyncio.loop.start_tls-- by :user:veeceey.Related issues and pull requests on GitHub:
#11859. -
Restored :py:meth:
~aiohttp.BodyPartReader.decodeas a synchronous method
for backward compatibility. The method was inadvertently changed to async
in 3.13.3 as part of the decompression bomb security fix. A new
:py:meth:~aiohttp.BodyPartReader.decode_itermethod is now available
for non-blocking decompression of large payloads using an async generator.
Internal aiohttp code uses the async variant to maintain security protections.Changed multipart processing chunk sizes from 64 KiB to 256KiB, to better
match aiohttp internals
-- by :user:bdracoand :user:Dreamsorcerer.Related issues and pull requests on GitHub:
#11898. -
Fixed false-positive :py:class:
DeprecationWarningfor passingenable_cleanup_closed=Trueto :py:class:~aiohttp.TCPConnectorspecifically on Python 3.12.7.
-- by :user:Robsdedude.Related issues and pull requests on GitHub:
#11972. -
Fixed _sendfile_fallback over-reading beyond requested count -- by :user:
bysiber.Related issues and pull requests on GitHub:
#12096. -
Fixed digest auth dropping challenge fields with empty string values -- by :user:
bysiber.Related issues and pull requests on GitHub:
#12097. -
ClientConnectorCertificateError.os_errorno longer raises :exc:AttributeError
-- by :user:themylogin.Related issues and pull requests on GitHub:
#12136. -
Adjusted pure-Python request header value validation to align with RFC 9110 control-character handling, while preserving lax response parser behavior, and added regression tests for Host/header control-character cases.
-- by :user:rodrigobnogueira.Related issues and pull requests on GitHub:
#12231. -
Rejected duplicate singleton headers (
Host,Content-Type,
Content-Length, etc.) in the C extension HTTP parser to match
the pure Python parser behaviour, preventing potential host-based
access control bypasses via parser differentials
-- by :user:rodrigobnogueira.Related issues and pull requests on GitHub:
#12240. -
Aligned the pure-Python HTTP request parser with the C parser by splitting
comma-separated and repeatedConnectionheader values for keep-alive,
close, and upgrade handling -- by :user:rodrigobnogueira.Related issues and pull requests on GitHub:
#12249.
Improved documentation
-
Documented :exc:
asyncio.TimeoutErrorforWebSocketResponse.receive()
and related methods -- by :user:veeceey.Related issues and pull requests on GitHub:
#12042.
Packaging updates and notes for downstreams
-
Upgraded llhttp to 3.9.1 -- by :user:
Dreamsorcerer.Related issues and pull requests on GitHub:
#12069.
Contributor-facing changes
-
The benchmark CI job now runs only in the upstream repository -- by :user:
Cycloctane.It used to always fail in forks, which this change fixed.
Related issues and pull requests on GitHub:
#11737. -
Fixed flaky performance tests by using appropriate fixed thresholds that account for CI variability -- by :user:
rodrigobnogueira.Related issues and pull requests on GitHub:
#11992.
Miscellaneous internal changes
-
Fixed
test_invalid_idnato work withidna3.11 by using an invalid character (\u0080) that is rejected byyarlduring URL construction -- by :user:rodrigobnogueira.Related issues and pull requests on GitHub:
#12027. -
Fixed race condition in
test_data_fileon Python 3.14 free-threaded builds -- by :user:rodrigobnogueira.Related issues and pull requests on GitHub:
#12170.
3.13.3
This release contains fixes for several vulnerabilities. It is advised to
upgrade as soon as possible.
Bug fixes
-
Fixed proxy authorization headers not being passed when reusing a connection, which caused 407 (Proxy authentication required) errors
-- by :user:GLeurquin.Related issues and pull requests on GitHub:
#2596. -
Fixed multipart reading failing when encountering an empty body part -- by :user:
Dreamsorcerer.Related issues and pull requests on GitHub:
#11857. -
Fixed a case where the parser wasn't raising an exception for a websocket continuation frame when there was no initial frame in context.
Related issues and pull requests on GitHub:
#11862.
Removals and backward incompatible breaking changes
-
Brotliandbrotlicffiminimum version is now 1.2.
Decompression now has a default maximum output size of 32MiB per decompress call -- by :user:Dreamsorcerer.Related issues and pull requests on GitHub:
#11898.
Packaging updates and notes for downstreams
-
Moved dependency metadata from :file:
setup.cfgto :file:pyproject.tomlper :pep:621
-- by :user:cdce8p.Related issues and pull requests on GitHub:
#11643.
Contributor-facing changes
-
Removed unused
update-pre-commitgithub action workflow -- by :user:Cycloctane.Related issues and pull requests on GitHub:
#11689.
Miscellaneous internal changes
-
Optimized web server performance when access logging is disabled by reducing time syscalls -- by :user:
bdraco.Related issues and pull requests on GitHub:
#10713. -
Added regression test for cached logging status -- by :user:
meehand.Related issues and pull requests on GitHub:
#11778.
3.13.2
Bug fixes
-
Fixed cookie parser to continue parsing subsequent cookies when encountering a malformed cookie that fails regex validation, such as Google's
g_statecookie with unescaped quotes -- by :user:bdraco.Related issues and pull requests on GitHub:
#11632. -
Fixed loading netrc credentials from the default :file:
~/.netrc(:file:~/_netrcon Windows) location when the :envvar:NETRCenvironment variable is not set -- by :user:bdraco. -
Fixed WebSocket compressed sends to be cancellation safe. Tasks are now shielded during compression to prevent compressor state corruption. This ensures that the stateful compressor remains consistent even when send operations are cancelled -- by :user:
bdraco.Related issues and pull requests on GitHub:
#11725.
3.13.1
Features
-
Make configuration options in
AppRunneralso available inrun_app()
-- by :user:Cycloctane.Related issues and pull requests on GitHub:
#11633.
Bug fixes
-
Switched to
backports.zstdfor Python <3.14 and fixed zstd decompression for chunked zstd streams -- by :user:ZhaoMJ.Note: Users who installed
zstandardfor support on Python <3.14 will now need to install
backports.zstdinstead (installingaiohttp[speedups]will do this automatically).Related issues and pull requests on GitHub:
#11623. -
Updated
Content-Typeheader parsing to returnapplication/octet-streamwhen header contains invalid syntax.
See :rfc:9110#section-8.3-5.-- by :user:
sgaist.Related issues and pull requests on GitHub:
#10889. -
Fixed Python 3.14 support when built without
zstdsupport -- by :user:JacobHenner.Related issues and pull requests on GitHub:
#11603. -
Fixed blocking I/O in the event loop when using netrc authentication by moving netrc file lookup to an executor -- by :user:
bdraco.Related issues and pull requests on GitHub:
#11634. -
Fixed routing to a sub-application added via
.add_domain()not working
if the same path exists on the parent app. -- by :user:Dreamsorcerer.Related issues and pull requests on GitHub:
#11673.
Packaging updates and notes for downstreams
-
Moved core packaging metadata from :file:
setup.cfgto :file:pyproject.tomlper :pep:621
-- by :user:cdce8p.Related issues and pull requests on GitHub:
#9951.
3.13.0
Features
-
Added support for Python 3.14.
-
Added support for free-threading in Python 3.14+ -- by :user:
kumaraditya303. -
Added support for Zstandard (aka Zstd) compression
-- by :user:KGuillaume-chaps.Related issues and pull requests on GitHub:
#11161. -
Added
StreamReader.total_raw_bytesto check the number of bytes downloaded
-- by :user:robpats.Related issues and pull requests on GitHub:
#11483.
Bug fixes
-
Fixed pytest plugin to not use deprecated :py:mod:
asynciopolicy APIs.Related issues and pull requests on GitHub:
#10851. -
Updated
Content-Dispositionheader parsing to handle trailing semicolons and empty parts
-- by :user:PLPeeters.Related issues and pull requests on GitHub:
#11243. -
Fixed saved
CookieJarfailing to be loaded if cookies havepartitionedflag when
http.cookiedoes not have partitioned cookies supports. -- by :user:Cycloctane.Related issues and pull requests on GitHub:
#11523.
Improved documentation
-
Added
Wireupto third-party libraries -- by :user:maldoinc.Related issues and pull requests on GitHub:
#11233.
Packaging updates and notes for downstreams
-
The
blockbustertest dependency is now optional; the corresponding test fixture is disabled when it is unavailable
-- by :user:musicinybrain.Related issues and pull requests on GitHub:
#11363. -
Added
riscv64build to releases -- by :user:eshattow.Related issues and pull requests on GitHub:
#11425.
Contributor-facing changes
-
Fixed
test_send_compress_textfailing when alternative zlib implementation
is used. (zlib-ngin python 3.14 windows build) -- by :user:Cycloctane.Related issues and pull requests on GitHub:
#11546.
3.12.15
Bug fixes
-
Fixed :class:
~aiohttp.DigestAuthMiddlewareto preserve the algorithm case from the server's challenge in the authorization response. This improves compatibility with servers that perform case-sensitive algorithm matching (e.g., servers expectingalgorithm=MD5-sessinstead ofalgorithm=MD5-SESS)
-- by :user:bdraco.Related issues and pull requests on GitHub:
#11352.
Improved documentation
-
Remove outdated contents of
aiohttp-devtoolsandaiohttp-swagger
from Web_advanced docs.
-- by :user:CycloctaneRelated issues and pull requests on GitHub:
#11347.
Packaging updates and notes for downstreams
-
Started including the
llhttp:file:LICENSEfile in wheels by addingvendor/llhttp/LICENSEtolicense-filesin :file:setup.cfg-- by :user:threexc.Related issues and pull requests on GitHub:
#11226.
Contributor-facing changes
-
Updated a regex in
test_aiohttp_request_coroutinefor Python 3.14.Related issues and pull requests on GitHub:
#11271.
3.12.14
Bug fixes
-
Fixed file uploads failing with HTTP 422 errors when encountering 307/308 redirects, and 301/302 redirects for non-POST methods, by preserving the request body when appropriate per :rfc:
9110#section-15.4.3-3.1-- by :user:bdraco.Related issues and pull requests on GitHub:
#11270. -
Fixed :py:meth:
ClientSession.close() <aiohttp.ClientSession.close>hanging indefinitely when using HTTPS requests through HTTP proxies -- by :user:bdraco.Related issues and pull requests on GitHub:
#11273. -
Bumped minimum version of aiosignal to 1.4+ to resolve typing issues -- by :user:
Dreamsorcerer.Related issues and pull requests on GitHub:
#11280.
Features
-
Added initial trailer parsing logic to Python HTTP parser -- by :user:
Dreamsorcerer.Related issues and pull requests on GitHub:
#11269.
Improved documentation
-
Clarified exceptions raised by
WebSocketResponse.send_frameet al.
-- by :user:DoctorJohn.Related issues and pull requests on GitHub:
#11234.
3.12.13
3.12.12
Bug fixes
-
Fixed cookie unquoting to properly handle octal escape sequences in cookie values (e.g.,
\012for newline) by vendoring the correct_unquoteimplementation from Python'shttp.cookiesmodule -- by :user:bdraco.Related issues and pull requests on GitHub:
#11173. -
Fixed
Cookieheader parsing to treat attribute names as regular cookies per :rfc:6265#section-5.4-- by :user:bdraco.Related issues and pull requests on GitHub:
#11178.