Update dependency httpx to v0.23.0 [SECURITY] #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==0.14.1
->==0.23.0
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
CVE-2021-41945
Encode OSS httpx <=1.0.0.beta0 is affected by improper input validation in
httpx.URL
,httpx.Client
and some functions usinghttpx.URL.copy_with
.Release Notes
encode/httpx (httpx)
v0.23.0
Compare Source
Changed
utf-8
as the default character set, instead of falling back tocharset-normalizer
for auto-detection. To enable automatic character set detection, see the documentation. (#2165)Fixed
URL.copy_with
for some oddly formed URL cases. (#2185)iter_bytes
never yields zero-length chunks. (#2068)Authorization
header for redirects that are to the same origin, but are anhttp
-to-https
upgrade. (#2074)<16086 bytes of binary data>
instead. (#2076)--proxies
argument in the command line client help. (#2125).request
onHTTPError
exceptions. (#2158)v0.22.0
Compare Source
Added
socksio
package. (#2034)Fixed
__del__
with unclosed clients. (#2026)Headers.update(...)
to correctly handle repeated headers (#2038)v0.21.3
Compare Source
Fixed
SyncByteStream
orAsyncByteStream
. Regression in 0.21.2. (#2016)v0.21.2
Compare Source
Fixed
v0.21.1
Compare Source
Fixed
response.url
property is now correctly annotated asURL
, instead ofOptional[URL]
. (#1940)v0.21.0
Compare Source
The 0.21.0 release integrates against a newly redesigned
httpcore
backend.Both packages ought to automatically update to the required versions, but if you are
seeing any issues, you should ensure that you have
httpx==0.21.*
andhttpcore==0.14.*
installed.Added
-v/--verbose
is used.-v/--verbose
is used.should be formatted as HTTP/1.1 or HTTP/2, based on the result of the HTTP/2 negotiation.
Removed
v0.20.0
Compare Source
The 0.20.0 release adds an integrated command-line client, and also includes some
design changes. The most notable of these is that redirect responses are no longer
automatically followed, unless specifically requested.
This design decision prioritises a more explicit approach to redirects, in order
to avoid code that unintentionally issues multiple requests as a result of
misconfigured URLs.
For example, previously a client configured to send requests to
http://api.github.com/
would end up sending every API request twice, as each request would be redirected to
https://api.github.com/
.If you do want auto-redirect behaviour, you can enable this either by configuring
the client instance with
Client(follow_redirects=True)
, or on a per-requestbasis, with
.get(..., follow_redirects=True)
.This change is a classic trade-off between convenience and precision, with no "right"
answer. See discussion #1785 for more
context.
The other major design change is an update to the Transport API, which is the low-level
interface against which requests are sent. Previously this interface used only primitive
datastructures, like so...
Now the interface is much simpler...
Changed
allow_redirects
flag is nowfollow_redirects
and defaults toFalse
.raise_for_status()
method will now raise an exception for any responsesexcept those with 2xx status codes. Previously only 4xx and 5xx status codes
would result in an exception.
response = transport.handle_request(request)
.client.send()
method no longer accepts atimeout=...
argument, but theclient.build_request()
does. This required by the signature change of theTransport API. The request timeout configuration is now stored on the request
instance, as
request.extensions['timeout']
.Added
httpx
command-line client..is_informational
,.is_success
,.is_redirect
,.is_client_error
, and.is_server_error
properties for checking 1xx, 2xx, 3xx, 4xx, and 5xx response types. Note that the behaviour of
.is_redirect
is slightly different in that it now returns True for all 3xx responses, in order to allow for a consistent set of properties onto the different HTTP status code types. Theresponse.has_redirect_location
location may be used to determine responses with properly formed URL redirects.Fixed
response.iter_bytes()
no longer raises a ValueError when called on a response with no content. (Pull #1827)'wsgi.error'
configuration now defaults tosys.stderr
, and is corrected to be aTextIO
interface, not aBytesIO
interface. Additionally, the WSGITransport now accepts awsgi_error
configuration. (Pull #1828)v0.19.0
Compare Source
Added
Client(allow_redirects=<bool>)
. (Pull #1790)charset
is included in the responseContent-Type
header. (Pull #1791)Changed
mode
argument fromhttpx.Proxy(..., mode=...)
. (Pull #1795)v0.18.2
Compare Source
Added
httpx.USE_CLIENT_DEFAULT
, used as the default toauth
andtimeout
parameters in request methods. (Pull #1634)httpx.Client(http1=False, http2=True)
. (Pull #1624)Fixed
v0.18.1
Compare Source
Changed
brotlicffi
package (Pull #1605)Request(..., stream=...)
does not auto-generate any headers on the request instance. (Pull #1607)Fixed
timeout=...
in top-level httpx.stream() function. (Pull #1613)v0.18.0
Compare Source
The 0.18.x release series formalises our low-level Transport API, introducing the base classes
httpx.BaseTransport
andhttpx.AsyncBaseTransport
.See the "Custom transports" documentation and the
httpx.BaseTransport.handle_request()
docstring for more complete details on implementing custom transports.Pull request #1522 includes a checklist of differences from the previous
httpcore
transport API, for developers implementing custom transports.The following API changes have been issuing deprecation warnings since 0.17.0 onwards, and are now fully deprecated...
Changed
httpx.BaseTransport
orhttpx.AsyncBaseTransport
,and should implement either the
handle_request
method orhandle_async_request
method. (Pull #1522, #1550)response.ext
property andResponse(ext=...)
argument are now namedextensions
. (Pull #1522)data=<bytes|str|bytes (a)iterator>
in favour ofcontent=<bytes|str|bytes (a)iterator>
has now been escalated to a deprecation warning. (Pull #1573)Response(on_close=...)
from API, since it was a bit of leaking implementation detail. (Pull #1572)httpx.ResponseClosed
is now namedhttpx.StreamClosed
. (#1584)httpx.QueryParams
model now presents an immutable interface. There is a discussion on the design and motivation here. Useclient.params = client.params.merge(...)
instead ofclient.params.update(...)
. The basic query manipulation methods arequery.set(...)
,query.add(...)
, andquery.remove()
. (#1600)Added
Request
andResponse
classes can now be serialized using pickle. (#1579)data={"key": [None|int|float|bool]}
cases. (Pull #1539)httpx.URL(**kwargs)
, for examplehttpx.URL(scheme="https", host="www.example.com", path="/')
, orhttpx.URL("https://www.example.com/", username="[email protected]", password="123 456")
. (Pull #1601)url.copy_with(params=...)
. (Pull #1601)url.params
parameter, returning an immutableQueryParams
instance. (Pull #1601)url.copy_set_param()
,url.copy_add_param()
,url.copy_remove_param()
,url.copy_merge_params()
. (Pull #1601)httpx.URL
class now performs port normalization, so:80
ports are stripped fromhttp
URLs and:443
ports are stripped fromhttps
URLs. (Pull #1603)URL.host
property returns unicode strings for internationalized domain names. TheURL.raw_host
property returns byte strings with IDNA escaping applied. (Pull #1590)Fixed
files=...
where unicode string is used as the file content. (Pull #1537)Client(base_url=...)
. (Pull #1532)request.content
attribute is now always available except for streaming content, which requires an explicit.read()
. (Pull #1583)v0.17.1
Compare Source
Fixed
CertTypes
allowskeyfile
andpassword
to be optional. (Pull #1503)v0.17.0
Compare Source
Added
httpx.MockTransport()
, allowing to mock out a transport using pre-determined responses. (Pull #1401, Pull #1449)httpx.HTTPTransport()
andhttpx.AsyncHTTPTransport()
default transports. (Pull #1399)httpx.Client(mounts=...)
. (Pull #1362)chunk_size
parameter toiter_raw()
,iter_bytes()
,iter_text()
. (Pull #1277)keepalive_expiry
parameter tohttpx.Limits()
configuration. (Pull #1398)httpx.Cookies
to display available cookies. (Pull #1411)params=<tuple>
(previously onlyparams=<list>
was supported). (Pull #1426)Fixed
raw_path
to ASGI scope. (Pull #1357)create_ssl_context
defaults to usetrust_env=True
. (Pull #1447)PATH_INFO
. (Pull #1391)base_url
. (Pull #1407)request.aclose()
. (Pull #1465)v0.16.1
Compare Source
Fixed
v0.16.0
Compare Source
Changed
response.next()
andresponse.anext()
methods in favour ofresponse.next_request
attribute. (Pull #1339)Added
__enter__
/__exit__
/__aenter__
/__aexit__
in a way that supports subclasses ofClient
andAsyncClient
. (Pull #1336)v0.15.5
Compare Source
Added
response.next_request
(Pull #1334)v0.15.4
Compare Source
Added
Headers
and dicts or lists of two-tuples. Eg.assert response.headers == {"Content-Length": 24}
(Pull #1326)Fixed
.read()
whenResponse
instances are created withcontent=<str>
(Pull #1324)v0.15.3
Compare Source
Fixed
v0.15.2
Compare Source
Fixed
response.elapsed
property. (Pull #1313).stream()
. (Pull #1312)v0.15.1
Compare Source
Fixed
path
component, as-per the ASGI spec. (Pull #1307)v0.15.0
Compare Source
Added
response.num_bytes_downloaded
. (Pull #1268)Request(content=...)
for byte content, instead of overloadingRequest(data=...)
(Pull #1266)url.copy_with(...)
. (Pull #1285)Request
instances, vs defaultclient.headers
. (Pull #1248)AsyncClient
instances will now raise warnings if garbage collected. (Pull #1197)Response(content=..., text=..., html=..., json=...)
for creating usable response instances in code. (Pull #1265, #1297)Changed
url.path
is now URL escaped. (Pull #1285)url.userinfo
andurl.query
are not URL escaped, and so return bytes. (Pull #1285)url.authority
property in favour ofurl.netloc
, since "authority" was semantically incorrect. (Pull #1285)url.full_path
property in favour ofurl.raw_path
, for better consistency with other parts of the API. (Pull #1285)chardet
library for auto-detecting charsets, instead defaulting to a simpler approach when no charset is specified. (#1269)Fixed
.netrc
lookups should use host, not host+port. (Pull #1298)Removed
URLLib3Transport
class no longer exists. We've published it instead as an example of a custom transport class. (Pull #1182)request.timer
attribute, which was being used internally to setresponse.elapsed
. (Pull #1249)response.decoder
attribute, which was being used internally. (Pull #1276)Request.prepare()
is now a private method. (Pull #1284)Headers.getlist()
method had previously been deprecated in favour ofHeaders.get_list()
. It is now fully removed.QueryParams.getlist()
method had previously been deprecated in favour ofQueryParams.get_list()
. It is now fully removed.URL.is_ssl
property had previously been deprecated in favour ofURL.scheme == "https"
. It is now fully removed.httpx.PoolLimits
class had previously been deprecated in favour ofhttpx.Limits
. It is now fully removed.max_keepalive
setting had previously been deprecated in favour of the more explicitmax_keepalive_connections
. It is now fully removed.httpx.Timeout(5.0, connect_timeout=60.0)
style had previously been deprecated in favour ofhttpx.Timeout(5.0, connect=60.0)
. It is now fully removed.httpx.Timeout(connect=60.0)
, had previously been deprecated in favour of enforcing a more explicit style, such ashttpx.Timeout(5.0, connect=60.0)
. This is now strictly enforced.v0.14.3
Compare Source
Added
http.Response()
may now be instantiated without arequest=...
parameter. Useful for some unit testing cases. (Pull #1238)103 Early Hints
and425 Too Early
status codes. (Pull #1244)Fixed
DigestAuth
now handles responses that include multiple 'WWW-Authenticate' headers. (Pull #1240)__enter__
/__exit__
or__aenter__
/__aexit__
when client is used in a context manager style. (Pull #1218)v0.14.2
Compare Source
Added
client.get(..., auth=None)
to bypass the default authentication on a clients. (Pull #1115)client.auth = ...
property setter. (Pull #1185)httpx.get(..., proxies=...)
on top-level request functions. (Pull #1198)cookies=[(key, value)]
list-of-two-tuples style usage. (Pull #1211)Fixed
Content-Length
header on streaming requests. (Pull #1170)HEAD
requests, settingallow_redirects=True
. (Pull #1183)httpx
exception, not the underlyinghttpcore
exception. (Pull #1190)httpcore
traceback, when transport exceptions occur. (Pull #1199)Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.