Releases: aio-libs/aiohttp
3.12.15
Bug fixes
-
Fixed :class:
~aiohttp.DigestAuthMiddleware
to 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-sess
instead ofalgorithm=MD5-SESS
)
-- by :user:bdraco
.Related issues and pull requests on GitHub:
#11352.
Improved documentation
-
Remove outdated contents of
aiohttp-devtools
andaiohttp-swagger
from Web_advanced docs.
-- by :user:Cycloctane
Related issues and pull requests on GitHub:
#11347.
Packaging updates and notes for downstreams
-
Started including the
llhttp
:file:LICENSE
file in wheels by addingvendor/llhttp/LICENSE
tolicense-files
in :file:setup.cfg
-- by :user:threexc
.Related issues and pull requests on GitHub:
#11226.
Contributor-facing changes
-
Updated a regex in
test_aiohttp_request_coroutine
for 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_frame
et 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.,
\012
for newline) by vendoring the correct_unquote
implementation from Python'shttp.cookies
module -- by :user:bdraco
.Related issues and pull requests on GitHub:
#11173. -
Fixed
Cookie
header 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.
3.12.11
Features
-
Improved SSL connection handling by changing the default
ssl_shutdown_timeout
from0.1
to0
seconds. SSL connections now use Python's default graceful
shutdown during normal operation but are aborted immediately when the connector
is closed, providing optimal behavior for both cases. Also added support for
ssl_shutdown_timeout=0
on all Python versions. Previously, this value was
rejected on Python 3.11+ and ignored on earlier versions. Non-zero values on
Python < 3.11 now trigger aRuntimeWarning
-- by :user:bdraco
.The
ssl_shutdown_timeout
parameter is now deprecated and will be removed in
aiohttp 4.0 as there is no clear use case for changing the default.Related issues and pull requests on GitHub:
#11148.
Deprecations (removal in next major release)
-
Improved SSL connection handling by changing the default
ssl_shutdown_timeout
from0.1
to0
seconds. SSL connections now use Python's default graceful
shutdown during normal operation but are aborted immediately when the connector
is closed, providing optimal behavior for both cases. Also added support for
ssl_shutdown_timeout=0
on all Python versions. Previously, this value was
rejected on Python 3.11+ and ignored on earlier versions. Non-zero values on
Python < 3.11 now trigger aRuntimeWarning
-- by :user:bdraco
.The
ssl_shutdown_timeout
parameter is now deprecated and will be removed in
aiohttp 4.0 as there is no clear use case for changing the default.Related issues and pull requests on GitHub:
#11148.
3.12.10
3.12.9
Bug fixes
-
Fixed
IOBasePayload
andTextIOPayload
reading entire files into memory when streaming large files -- by :user:bdraco
.When using file-like objects with the aiohttp client, the entire file would be read into memory if the file size was provided in the
Content-Length
header. This could cause out-of-memory errors when uploading large files. The payload classes now correctly read data in chunks ofREAD_SIZE
(64KB) regardless of the total content length.Related issues and pull requests on GitHub:
#11138.
3.12.8
Features
-
Added preemptive digest authentication to :class:
~aiohttp.DigestAuthMiddleware
-- by :user:bdraco
.The middleware now reuses authentication credentials for subsequent requests to the same
protection space, improving efficiency by avoiding extra authentication round trips.
This behavior matches how web browsers handle digest authentication and follows
:rfc:7616#section-3.6
.Preemptive authentication is enabled by default but can be disabled by passing
preemptive=False
to the middleware constructor.
3.12.7
Warning
This release fixes an issue where the quote_cookie
parameter was not being properly respected for shared cookies (domain="", path=""). If your server does not handle quoted cookies correctly, you may need to disable cookie quoting by setting quote_cookie=False
when creating your ClientSession
or CookieJar
.
See https://docs.aiohttp.org/en/stable/client_advanced.html#cookie-quoting-routine for details.
Bug fixes
-
Fixed cookie parsing to be more lenient when handling cookies with special characters
in names or values. Cookies with characters like{
,}
, and/
in names are now
accepted instead of causing a :exc:~http.cookies.CookieError
and 500 errors. Additionally,
cookies with mismatched quotes in values are now parsed correctly, and quoted cookie
values are now handled consistently whether or not they include special attributes
likeDomain
. Also fixed :class:~aiohttp.CookieJar
to ensure shared cookies (domain="", path="")
respect thequote_cookie
parameter, making cookie quoting behavior consistent for
all cookies -- by :user:bdraco
.Related issues and pull requests on GitHub:
#2683, #5397, #7993, #11112. -
Fixed an issue where cookies with duplicate names but different domains or paths
were lost when updating the cookie jar. The :class:~aiohttp.ClientSession
cookie jar now correctly stores all cookies even if they have the same name but
different domain or path, following the :rfc:6265#section-5.3
storage model -- by :user:bdraco
.Note that :attr:
ClientResponse.cookies <aiohttp.ClientResponse.cookies>
returns
a :class:~http.cookies.SimpleCookie
which uses the cookie name as a key, so
only the last cookie with each name is accessible via this interface. All cookies
can be accessed via :meth:ClientResponse.headers.getall('Set-Cookie') <multidict.MultiDictProxy.getall>
if needed.Related issues and pull requests on GitHub:
#4486, #11105, #11106.
Miscellaneous internal changes
-
Avoided creating closed futures in
ResponseHandler
that will never be awaited -- by :user:bdraco
.Related issues and pull requests on GitHub:
#11107. -
Downgraded the logging level for connector close errors from ERROR to DEBUG, as these are expected behavior with TLS 1.3 connections -- by :user:
bdraco
.Related issues and pull requests on GitHub:
#11114.
3.12.7rc0
Bug fixes
-
Fixed cookie parsing to be more lenient when handling cookies with special characters
in names or values. Cookies with characters like{
,}
, and/
in names are now
accepted instead of causing a :exc:~http.cookies.CookieError
and 500 errors. Additionally,
cookies with mismatched quotes in values are now parsed correctly, and quoted cookie
values are now handled consistently whether or not they include special attributes
likeDomain
. Also fixed :class:~aiohttp.CookieJar
to ensure shared cookies (domain="", path="")
respect thequote_cookie
parameter, making cookie quoting behavior consistent for
all cookies -- by :user:bdraco
.Related issues and pull requests on GitHub:
#2683, #5397, #7993, #11112. -
Fixed an issue where cookies with duplicate names but different domains or paths
were lost when updating the cookie jar. The :class:~aiohttp.ClientSession
cookie jar now correctly stores all cookies even if they have the same name but
different domain or path, following the :rfc:6265#section-5.3
storage model -- by :user:bdraco
.Note that :attr:
ClientResponse.cookies <aiohttp.ClientResponse.cookies>
returns
a :class:~http.cookies.SimpleCookie
which uses the cookie name as a key, so
only the last cookie with each name is accessible via this interface. All cookies
can be accessed via :meth:ClientResponse.headers.getall('Set-Cookie') <multidict.MultiDictProxy.getall>
if needed.Related issues and pull requests on GitHub:
#4486, #11105, #11106.
Miscellaneous internal changes
-
Avoided creating closed futures in
ResponseHandler
that will never be awaited -- by :user:bdraco
.Related issues and pull requests on GitHub:
#11107. -
Downgraded the logging level for connector close errors from ERROR to DEBUG, as these are expected behavior with TLS 1.3 connections -- by :user:
bdraco
.Related issues and pull requests on GitHub:
#11114.