Update all dependencies #9
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/all"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.0.66
->1.0.67
0.5
->0.6
1.0.89
->1.0.90
1.22
->1.23
Release Notes
dtolnay/anyhow
v1.0.67
Compare Source
context()
is used on anOption
(#280)tokio-rs/axum
v0.6.1
: axum - v0.6.1Compare Source
Router::with_state
(#1580)v0.6.0
: axum - v0.6.0Compare Source
Routing
fixed: Nested routers are now allowed to have fallbacks (#1521):
The outer router's fallback will still apply if a nested router doesn't have
its own fallback:
breaking: The request
/foo/
no longer matches/foo/*rest
. If you wantto match
/foo/
you have to add a route specifically for that (#1086)For example:
breaking: Path params for wildcard routes no longer include the prefix
/
. e.g./foo.js
will match/*filepath
with a value offoo.js
, not/foo.js
(#1086)For example:
fixed: Routes like
/foo
and/*rest
are no longer consideredoverlapping.
/foo
will take priority (#1086)For example:
breaking: Automatic trailing slash redirects have been removed.
Previously if you added a route for
/foo
, axum would redirect calls to/foo/
to/foo
(or vice versa for/foo/
):Either explicitly add routes for
/foo
and/foo/
or useaxum_extra::routing::RouterExt::route_with_tsr
if you want the old behavior(#1119)
breaking:
Router::fallback
now only acceptsHandler
s (similarly towhat
get
,post
, etc. accept). Use the newRouter::fallback_service
forsetting any
Service
as the fallback (#1155)This fallback on 0.5:
Becomes this in 0.6
changed:
Router::nest
now only acceptsRouter
s, the general-purposeService
nesting method has been renamed tonest_service
(#1368)breaking: Allow
Error: Into<Infallible>
forRoute::{layer, route_layer}
(#924)breaking:
MethodRouter
now panics on overlapping routes (#1102)breaking:
Router::route
now only acceptsMethodRouter
s created withget
,post
, etc. Use the newRouter::route_service
for routing toany
Service
s (#1155)breaking: Adding a
.route_layer
onto aRouter
orMethodRouter
without any routes will now result in a panic. Previously, this just did
nothing. #1327
breaking:
RouterService
has been removed sinceRouter
now implementsService
when the state is()
. UseRouter::with_state
to provide thestate and get a
Router<()>
. Note thatRouterService
only existed in thepre-releases, not 0.5 (#1552)
Extractors
added: Added new type safe
State
extractor. This can be used withRouter::with_state
and gives compile errors for missing states, whereasExtension
would result in runtime errors (#1155)We recommend migrating from
Extension
toState
for sharing application state since that is more typesafe and faster. That is done by using
Router::with_state
andState
.This setup in 0.5
Becomes this in 0.6 using
State
:If you have multiple extensions, you can use fields on
AppState
and implementFromRef
:breaking: It is now only possible for one extractor per handler to consume
the request body. In 0.5 doing so would result in runtime errors but in 0.6 it
is a compile error (#1272)
axum enforces this by only allowing the last extractor to consume the
request.
For example:
This is done by reworking the
FromRequest
trait and introducing a newFromRequestParts
trait.If your extractor needs to consume the request body then you should implement
FromRequest
, otherwise implementFromRequestParts
.This extractor in 0.5:
Becomes this in 0.6:
For an example of how to write an extractor that accepts different
Content-Types
see the [parse-body-based-on-content-type
][parse-body-based-on-content-type] example.added:
FromRequest
andFromRequestParts
derive macro re-exports from[
axum-macros
][axum-macros] behind themacros
feature (#1352)added: Add
RequestExt
andRequestPartsExt
which adds conveniencemethods for running extractors to
http::Request
andhttp::request::Parts
(#1301)added:
JsonRejection
now displays the path at which a deserializationerror occurred (#1371)
added: Add
extract::RawForm
for accessing raw urlencoded query bytes or request body (#1487)fixed: Used
400 Bad Request
forFailedToDeserializeQueryString
rejections, instead of
422 Unprocessable Entity
(#1387)changed: The inner error of a
JsonRejection
is nowserde_path_to_error::Error<serde_json::Error>
. Previously it wasserde_json::Error
(#1371)changed: The default body limit now applies to the
Multipart
extractor (#1420)breaking:
ContentLengthLimit
has been removed. UseDefaultBodyLimit
instead (#1400)breaking:
RequestParts
has been removed as part of theFromRequest
rework (#1272)
breaking:
BodyAlreadyExtracted
has been removed (#1272)breaking: The following types or traits have a new
S
type paramwhich represents the state (#1155):
Router
, defaults to()
MethodRouter
, defaults to()
FromRequest
, no defaultHandler
, no defaultbreaking:
MatchedPath
can now no longer be extracted in middleware fornested routes. In previous versions it returned invalid data when extracted
from a middleware applied to a nested router.
MatchedPath
can still beextracted from handlers and middleware that aren't on nested routers (#1462)
breaking: Rename
FormRejection::FailedToDeserializeQueryString
toFormRejection::FailedToDeserializeForm
(#1496)Middleware
middleware::from_fn
functions (#1088)middleware::from_fn_with_state
to enable running extractors that requirestate (#1342)
middleware::from_extractor_with_state
(#1396)map_request
,map_request_with_state
for transforming therequest with an async function (#1408)
map_response
,map_response_with_state
for transforming theresponse with an async function (#1414)
IntoResponse
(#1152)extractor_middleware
which was previously deprecated.Use
axum::middleware::from_extractor
instead (#1077)Handler::layer
to haveInfallible
as the error type (#1152)Misc
simple-router-wasm
examplefor more details (#1382)
ServiceExt
with methods for turning anyService
into aMakeService
similarly toRouter::into_make_service
(#1302)From
impls have been added toextract::ws::Message
to be more inline with
tungstenite
(#1421)#[derive(axum::extract::FromRef)]
(#1430)accept_unmasked_frames
setting in WebSocketUpgrade (#1529)WebSocketUpgrade::on_failed_upgrade
to customize what to dowhen upgrading a connection fails (#1539)
#[track_caller]
so the errormessage points to where the user added the invalid route, rather than
somewhere internally in axum (#1248)
S: Service
, the bounds have beenrelaxed so the response type must implement
IntoResponse
rather than being aliteral
Response
tokio
default feature needed for WASM support. If youdon't need WASM support but have
default_features = false
for other reasonsyou likely need to re-enable the
tokio
feature (#1382)handler::{WithState, IntoService}
are merged into one type,named
HandlerService
(#1418)v0.5.17
: axum - v0.5.17Compare Source
#[track_caller]
so the errormessage points to where the user added the invalid router, rather than
somewhere internally in axum (#1248)
Multipart
extractor work withRequestBodyLimit
middleware (#1379)DefaultBodyLimit::max
for changing the default body limit (#1397)v0.5.16
: axum - v0.5.16Compare Source
Security
breaking: Added default limit to how much data
Bytes::from_request
willconsume. Previously it would attempt to consume the entire request body
without checking its length. This meant if a malicious peer sent an large (or
infinite) request body your server might run out of memory and crash.
The default limit is at 2 MB and can be disabled by adding the new
DefaultBodyLimit::disable()
middleware. See its documentation for moredetails.
This also applies to these extractors which used
Bytes::from_request
internally:
Form
Json
String
Thanks to Shachar Menashe for reporting this vulnerability.
(#1346)
v0.5.15
: axum - v0.5.15Compare Source
Note: This is a re-release of 0.5.14 that fixes an accidental breaking change.
QueryRejection
response. (#1171)v0.5.14
: axum - v0.5.14Compare Source
Yanked, as it contained an accidental breaking change.
v0.5.13
: axum - v0.5.13Compare Source
WebSocketUpgrade
cannot upgrade the connection it will return aWebSocketUpgradeRejection::ConnectionNotUpgradable
rejection (#1135)WebSocketUpgradeRejection
has a new variantConnectionNotUpgradable
variant (#1135)
v0.5.12
: axum - v0.5.12Compare Source
debug_handler
which is an attribute macro that improvestype errors when applied to handler function. It is re-exported from
axum-macros
(#1144)v0.5.11
: axum - v0.5.11Compare Source
TryFrom<http:: Method>
forMethodFilter
and use newNoMatchingMethodFilter
error in case of failure (#1130)v0.5.10
: axum - v0.5.10Compare Source
Router
cheaper to clone (#1123)v0.5.9
: axum - v0.5.9Compare Source
headers
is enabled and theform
feature is disabled (#1107)
v0.5.8
: axum - v0.5.8Compare Source
Forwarded
header inHost
extractor (#1078)
IntoResponse
forForm
(#1095)v0.5.7
: axum - v0.5.7Compare Source
Default
forExtension
(#1043)Vec<(String, String)>
inextract::Path<_>
to get vector ofkey/value pairs (#1059)
extract::ws::close_code
which contains constants for close codes (#1067)impl IntoResponse
less in docs (#1049)v0.5.6
: axum - v0.5.6Compare Source
WebSocket::protocol
to return the selected WebSocket subprotocol, if there is one. (#1022)PathRejection::WrongNumberOfParameters
to hint at usingPath<(String, String)>
orPath<SomeStruct>
(#1023)PathRejection::WrongNumberOfParameters
now uses500 Internal Server Error
sinceit's a programmer error and not a client error (#1023)
InvalidFormContentType
mentioning the wrong content typev0.5.5
: axum - v0.5.5Compare Source
GET
,HEAD
, andOPTIONS
requests inContentLengthLimit
.Request with these methods are now accepted if they do not have a
Content-Length
header, andthe request body will not be checked. If they do have a
Content-Length
header they'll berejected. This allows
ContentLengthLimit
to be used as middleware around several routes,including
GET
routes (#989)MethodRouter::{into_make_service, into_make_service_with_connect_info}
(#1010)v0.5.4
: axum - v0.5.4Compare Source
response::ErrorResponse
andresponse::Result
forIntoResponse
-based error handling (#921)middleware::from_extractor
and deprecateextract::extractor_middleware
(#957)v0.5.3
: axum - v0.5.3Compare Source
AppendHeaders
for appending headers to a response rather than overriding them (#927)axum::extract::multipart::Field::chunk
method for streaming a single chunk fromthe field (#901)
v0.5.2
: axum - v0.5.2Compare Source
Yanked, as it contained an accidental breaking change.
v0.5.1
: axum - v0.5.1Compare Source
RequestParts::extract
which allows applying an extractor as a method call ([#897)serde-rs/json
v1.0.90
Compare Source
tokio-rs/tokio
v1.23.0
: Tokio v1.23.0Compare Source
Fixed
ChildStdin
(#5216)async fn ready()
false positive for OS-specific events (#5231)Changed
yield_now
defers task until after driver poll (#5223)winapi
dependency withwindows-sys
(#5204)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.
c2796247ce
to8f2544deb0
Update Rust crate axum to 0.6to Update all dependencies8f2544deb0
to06ae52717d