fix(deps): update rust crate axum to 0.6.20#7
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.6.0-rc.1->0.6.20Release Notes
tokio-rs/axum (axum)
v0.6.20: axum - v0.6.20Compare Source
WebSocketUpgrade::write_buffer_sizeandWebSocketUpgrade::max_write_buffer_sizeWebSocketUpgrade::max_send_queueHandlerforT: IntoResponse(#2140)v0.6.19: axum - v0.6.19Compare Source
axum::extract::Query::try_from_uri(#2058)IntoResponseforBox<str>andBox<[u8]>(#2035).source()of composite rejections (#2030)#[debug_handler](#2014)v0.6.18: axum - v0.6.18Compare Source
Sec-WebSocket-Keyheader inWebSocketUpgrade(#1972)v0.6.17: axum - v0.6.17Compare Source
CONNECTrequests (#1958)v0.6.16: axum - v0.6.16Compare Source
MatchedPathin fallbacks (#1934)Routerwith something nested at/was used as a fallback (#1934)Router::new().fallback(...)isn't optimal (#1940)v0.6.15: axum - v0.6.15Compare Source
v0.6.14: axum - v0.6.14Compare Source
v0.6.13: axum - v0.6.13Compare Source
axum::rejection=tracetarget (#1890)Router::nestintroduced in0.6.0.
nestnow flattens the routes which performs better (#1711)MatchedPathin nested handlers now gives the fullmatched path, including the nested path (#1711)
DerefandDerefMutfor built-in extractors (#1922)v0.6.12: axum - v0.6.12Compare Source
IntoResponseforMultipartError(#1861)v0.6.11: axum - v0.6.11Compare Source
S: Debugforimpl Debug for Router<S>(#1836)v0.6.10: axum - v0.6.10Compare Source
#[must_use]attributes to types that do nothing unless used (#1809)TypedHeaderextractor (#1810)Routervia a dynamic library (#1806)v0.6.9: axum - v0.6.9Compare Source
v0.6.8: axum - v0.6.8Compare Source
Allowmissing from routers with middleware (#1773)KeepAlive::eventfor customizing the event sent for SSE keep alive (#1729)v0.6.7: axum - v0.6.7Compare Source
FormRejection::FailedToDeserializeFormBodywhich is returnedif the request body couldn't be deserialized into the target type, as opposed
to
FailedToDeserializeFormwhich is only for query parameters (#1683)MockConnectInfofor settingConnectInfoduring tests (#1767)v0.6.6: axum - v0.6.6Compare Source
MethodRoutertoRouter::fallback(#1730)v0.6.5: axum - v0.6.5Compare Source
#[debug_handler]sometimes giving wrong borrow related suggestions (#1710)impl IntoResponseas the return type from handler functions (#1736)v0.6.4: axum - v0.6.4Compare Source
v0.6.3: axum - v0.6.3Compare Source
IntoResponsefor&'static [u8; N]and[u8; N](#1690)Pathsupport types usingserde::Deserializer::deserialize_any(#1693)RawPathParams(#1713)CloneandServiceforaxum::middleware::Next(#1712)v0.6.2: axum - v0.6.2Compare Source
body_textandstatusmethods to built-in rejections (#1612)runtimefeature ofhyperwhen usingtokio(#1671)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.jswill match/*filepathwith a value offoo.js, not/foo.js(#1086)For example:
fixed: Routes like
/fooand/*restare no longer consideredoverlapping.
/foowill 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
/fooand/foo/or useaxum_extra::routing::RouterExt::route_with_tsrif you want the old behavior(#1119)
breaking:
Router::fallbacknow only acceptsHandlers (similarly towhat
get,post, etc. accept). Use the newRouter::fallback_serviceforsetting any
Serviceas the fallback (#1155)This fallback on 0.5:
Becomes this in 0.6
changed:
Router::nestnow only acceptsRouters, the general-purposeServicenesting method has been renamed tonest_service(#1368)breaking: Allow
Error: Into<Infallible>forRoute::{layer, route_layer}(#924)breaking:
MethodRouternow panics on overlapping routes (#1102)breaking:
Router::routenow only acceptsMethodRouters created withget,post, etc. Use the newRouter::route_servicefor routing toany
Services (#1155)breaking: Adding a
.route_layeronto aRouterorMethodRouterwithout any routes will now result in a panic. Previously, this just did
nothing. #1327
breaking:
RouterServicehas been removed sinceRouternow implementsServicewhen the state is(). UseRouter::with_stateto provide thestate and get a
Router<()>. Note thatRouterServiceonly existed in thepre-releases, not 0.5 (#1552)
Extractors
added: Added new type safe
Stateextractor. This can be used withRouter::with_stateand gives compile errors for missing states, whereasExtensionwould result in runtime errors (#1155)We recommend migrating from
ExtensiontoStatefor sharing application state since that is more typesafe and faster. That is done by using
Router::with_stateandState.This setup in 0.5
Becomes this in 0.6 using
State:If you have multiple extensions, you can use fields on
AppStateand 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
FromRequesttrait and introducing a newFromRequestPartstrait.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-Typessee the [parse-body-based-on-content-type][parse-body-based-on-content-type] example.added:
FromRequestandFromRequestPartsderive macro re-exports from[
axum-macros][axum-macros] behind themacrosfeature (#1352)added: Add
RequestExtandRequestPartsExtwhich adds conveniencemethods for running extractors to
http::Requestandhttp::request::Parts(#1301)added:
JsonRejectionnow displays the path at which a deserializationerror occurred (#1371)
added: Add
extract::RawFormfor accessing raw urlencoded query bytes or request body (#1487)fixed: Used
400 Bad RequestforFailedToDeserializeQueryStringrejections, instead of
422 Unprocessable Entity(#1387)changed: The inner error of a
JsonRejectionis nowserde_path_to_error::Error<serde_json::Error>. Previously it wasserde_json::Error(#1371)changed: The default body limit now applies to the
Multipartextractor (#1420)breaking:
ContentLengthLimithas been removed. UseDefaultBodyLimitinstead (#1400)breaking:
RequestPartshas been removed as part of theFromRequestrework (#1272)
breaking:
BodyAlreadyExtractedhas been removed (#1272)breaking: The following types or traits have a new
Stype paramwhich represents the state (#1155):
Router, defaults to()MethodRouter, defaults to()FromRequest, no defaultHandler, no defaultbreaking:
MatchedPathcan 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.
MatchedPathcan still beextracted from handlers and middleware that aren't on nested routers (#1462)
breaking: Rename
FormRejection::FailedToDeserializeQueryStringtoFormRejection::FailedToDeserializeForm(#1496)Middleware
middleware::from_fnfunctions (#1088)middleware::from_fn_with_stateto enable running extractors that requirestate (#1342)
middleware::from_extractor_with_state(#1396)map_request,map_request_with_statefor transforming therequest with an async function (#1408)
map_response,map_response_with_statefor transforming theresponse with an async function (#1414)
IntoResponse(#1152)extractor_middlewarewhich was previously deprecated.Use
axum::middleware::from_extractorinstead (#1077)Handler::layerto haveInfallibleas the error type (#1152)Misc
simple-router-wasmexamplefor more details (#1382)
ServiceExtwith methods for turning anyServiceinto aMakeServicesimilarly toRouter::into_make_service(#1302)Fromimpls have been added toextract::ws::Messageto be more inline with
tungstenite(#1421)#[derive(axum::extract::FromRef)](#1430)accept_unmasked_framessetting in WebSocketUpgrade (#1529)WebSocketUpgrade::on_failed_upgradeto 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
IntoResponserather than being aliteral
Responsetokiodefault feature needed for WASM support. If youdon't need WASM support but have
default_features = falsefor other reasonsyou likely need to re-enable the
tokiofeature (#1382)handler::{WithState, IntoService}are merged into one type,named
HandlerService(#1418)v0.6.0-rc.5: axum - v0.6.0-rc.5Compare Source
breaking:
Router::with_stateis no longer a constructor. It is insteadused to convert the router into a
RouterService(#1532)This nested router on 0.6.0-rc.4
Becomes this in 0.6.0-rc.5
breaking::
Router::inherit_statehas been removed. UseRouter::with_stateinstead (#1532)breaking::
Router::nestandRouter::mergenow only supports nestingrouters that use the same state type as the router they're being merged into.
Use
FromReffor substates (#1532)added: Add
accept_unmasked_framessetting in WebSocketUpgrade (#1529)fixed: Nested routers will now inherit fallbacks from outer routers (#1521)
added: Add
WebSocketUpgrade::on_failed_upgradeto customize what to dowhen upgrading a connection fails (#1539)
v0.6.0-rc.4: axum - v0.6.0-rc.4Compare Source
JsonRejectionis nowserde_path_to_error::Error<serde_json::Error>. Previously it wasserde_json::Error(#1371)JsonRejectionnow displays the path at which a deserializationerror occurred too (#1371)
ContentLengthLimit(#1389)400 Bad RequestforFailedToDeserializeQueryStringrejections, instead of
422 Unprocessable Entity(#1387)middleware::from_extractor_with_stateandmiddleware::from_extractor_with_state_arc(#1396)DefaultBodyLimit::maxfor changing the default body limit (#1397)map_request,map_request_with_state, andmap_request_with_state_arcfor transforming the request with an asyncfunction (#1408)
map_response,map_response_with_state, andmap_response_with_state_arcfor transforming the response with an asyncfunction (#1414)
ContentLengthLimithas been removed.Use DefaultBodyLimitinstead (#1400)Routerno longer implementsService, call.into_service()on it to obtain a
RouterServicethat does (#1368)Router::inherit_state, which creates aRouterwith anarbitrary state type without actually supplying the state; such a
Routercan't be turned into a service directly (
.into_service()will panic), butcan be nested or merged into a
Routerwith the same state type (#1368)Router::nestnow only acceptsRouters, the general-purposeServicenesting method has been renamed tonest_service(#1368)simple-router-wasmexamplefor more details (#1382)
tokiodefault feature needed for WASM support. If youdon't need WASM support but have
default_features = falsefor other reasonsyou likely need to re-enable the
tokiofeature (#1382)handler::{WithState, IntoService}are merged into one type,named
HandlerService(#1418)Multipartextractor (#1420)Fromimpls have been added toextract::ws::Messageto be more inline with
tungstenite(#1421)#[derive(axum::extract::FromRef)]([#1430])FromRequestandFromRequestPartsderive macro re-exports from[
axum-macros] behind themacrosfeature (#1352)MatchedPathcan now no longer be extracted in middleware fornested routes (#1462)
extract::RawFormfor accessing raw urlencoded query bytes or request body (#1487)FormRejection::FailedToDeserializeQueryStringtoFormRejection::FailedToDeserializeForm(#1496)v0.6.0-rc.3: axum - v0.6.0-rc.3Compare Source
Yanked, as it didn't compile in release mode.
v0.6.0-rc.2: axum - v0.6.0.rc.2Compare Source
Security
breaking: Added default limit to how much data
Bytes::from_requestwillconsume. 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_requestinternally:
FormJsonStringThanks to Shachar Menashe for reporting this vulnerability.
(#1346)
Routing
.route_layeronto aRouterorMethodRouterwithout any routes will now result in a panic. Previously, this just did
nothing. #1327
Middleware
middleware::from_fn_with_stateandmiddleware::from_fn_with_state_arcto enable running extractors that requirestate (#1342)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), 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 has been generated by Mend Renovate. View repository job log here.