Update Rust crate axum to 0.5 - autoclosed #5
Reference in New Issue
Block a user
Delete Branch "renovate/axum-0.x"
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:
0.4->0.5Release Notes
tokio-rs/axum
v0.5.17#[track_caller]so the errormessage points to where the user added the invalid router, rather than
somewhere internally in axum (#1248)
Multipartextractor work withRequestBodyLimitmiddleware (#1379)DefaultBodyLimit::maxfor changing the default body limit (#1397)v0.5.16Security
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)
v0.5.15Note: This is a re-release of 0.5.14 that fixes an accidental breaking change.
QueryRejectionresponse. (#1171)v0.5.14Yanked, as it contained an accidental breaking change.
v0.5.13WebSocketUpgradecannot upgrade the connection it will return aWebSocketUpgradeRejection::ConnectionNotUpgradablerejection (#1135)WebSocketUpgradeRejectionhas a new variantConnectionNotUpgradablevariant (#1135)
v0.5.12debug_handlerwhich is an attribute macro that improvestype errors when applied to handler function. It is re-exported from
axum-macros(#1144)v0.5.11TryFrom<http:: Method>forMethodFilterand use newNoMatchingMethodFiltererror in case of failure (#1130)v0.5.10Routercheaper to clone (#1123)v0.5.9headersis enabled and theformfeature is disabled (#1107)
v0.5.8Forwardedheader inHostextractor (#1078)
IntoResponseforForm(#1095)v0.5.7DefaultforExtension(#1043)Vec<(String, String)>inextract::Path<_>to get vector ofkey/value pairs (#1059)
extract::ws::close_codewhich contains constants for close codes (#1067)impl IntoResponseless in docs (#1049)v0.5.6WebSocket::protocolto return the selected WebSocket subprotocol, if there is one. (#1022)PathRejection::WrongNumberOfParametersto hint at usingPath<(String, String)>orPath<SomeStruct>(#1023)PathRejection::WrongNumberOfParametersnow uses500 Internal Server Errorsinceit's a programmer error and not a client error (#1023)
InvalidFormContentTypementioning the wrong content typev0.5.5GET,HEAD, andOPTIONSrequests inContentLengthLimit.Request with these methods are now accepted if they do not have a
Content-Lengthheader, andthe request body will not be checked. If they do have a
Content-Lengthheader they'll berejected. This allows
ContentLengthLimitto be used as middleware around several routes,including
GETroutes (#989)MethodRouter::{into_make_service, into_make_service_with_connect_info}(#1010)v0.5.4response::ErrorResponseandresponse::ResultforIntoResponse-based error handling (#921)middleware::from_extractorand deprecateextract::extractor_middleware(#957)v0.5.3AppendHeadersfor appending headers to a response rather than overriding them (#927)axum::extract::multipart::Field::chunkmethod for streaming a single chunk fromthe field (#901)
v0.5.2Yanked, as it contained an accidental breaking change.
v0.5.1Compare Source
RequestParts::extractwhich allows applying an extractor as a method call ([#897)v0.5.0Compare Source
added: Document sharing state between handler and middleware (#783)
added:
Extension<_>can now be used in tuples for building responses, and will set anextension on the response (#797)
added:
extract::Hostfor extracting the hostname of a request (#827)added: Add
IntoResponsePartstrait which allows defining custom responsetypes for adding headers or extensions to responses (#797)
added:
TypedHeaderimplements the newIntoResponsePartstrait so theycan be returned from handlers as parts of a response (#797)
changed:
Router::mergenow acceptsInto<Router>(#819)breaking:
sse::Eventnow accepts types implementingAsRef<str>instead ofInto<String>as field values.
breaking:
sse::Eventnow panics if a setter method is called twice instead of silentlyoverwriting old values.
breaking: Require
Output = ()onWebSocketStream::on_upgrade(#644)breaking: Make
TypedHeaderRejectionReason#[non_exhaustive](#665)breaking: Using
HeaderMapas an extractor will no longer remove the headers and thusthey'll still be accessible to other extractors, such as
axum::extract::Json. InsteadHeaderMapwill clone the headers. You should prefer to useTypedHeaderto extract only theheaders you need (#698)
This includes these breaking changes:
RequestParts::take_headershas been removed.RequestParts::headersreturns&HeaderMap.RequestParts::headers_mutreturns&mut HeaderMap.HeadersAlreadyExtractedhas been removed.HeadersAlreadyExtractedvariant has been removed from these rejections:RequestAlreadyExtractedRequestPartsAlreadyExtractedJsonRejectionFormRejectionContentLengthLimitRejectionWebSocketUpgradeRejection<HeaderMap as FromRequest<_>>::Rejectionhas been changed tostd::convert::Infallible.breaking:
axum::http::Extensionsis no longer an extractor (ie itdoesn't implement
FromRequest). Theaxum::extract::Extensionextractor isnot impacted by this and works the same. This change makes it harder to
accidentally remove all extensions which would result in confusing errors
elsewhere (#699)
This includes these breaking changes:
RequestParts::take_extensionshas been removed.RequestParts::extensionsreturns&Extensions.RequestParts::extensions_mutreturns&mut Extensions.RequestAlreadyExtractedhas been removed.<Request as FromRequest>::Rejectionis nowBodyAlreadyExtracted.<http::request::Parts as FromRequest>::Rejectionis nowInfallible.ExtensionsAlreadyExtractedhas been removed.ExtensionsAlreadyExtractedremoved variant has been removed from these rejections:ExtensionRejectionPathRejectionMatchedPathRejectionWebSocketUpgradeRejectionbreaking:
Redirect::foundhas been removed (#800)breaking:
AddExtensionLayerhas been removed. UseExtensioninstead. It now implementstower::Layer(#807)breaking:
AddExtensionhas been moved from the root module tomiddlewarebreaking:
.nest("/foo/", Router::new().route("/bar", _))now does the right thing andresults in a route at
/foo/barinstead of/foo//bar(#824)breaking: Routes are now required to start with
/. Previously routes such as:foowouldbe accepted but most likely result in bugs (#823)
breaking:
Headershas been removed. Arrays of tuples directly implementIntoResponsePartsso([("x-foo", "foo")], response)now works (#797)breaking:
InvalidJsonBodyhas been replaced withJsonDataErrorto clearly signal that therequest body was syntactically valid JSON but couldn't be deserialized into the target type
breaking:
Handleris no longer an#[async_trait]but instead has anassociated
Futuretype. That allows users to build their ownHandlertypeswithout paying the cost of
#[async_trait](#879)changed: New
JsonSyntaxErrorvariant added toJsonRejection. This is returned when therequest body contains syntactically invalid JSON
fixed: Correctly set the
Content-Lengthheader for response toHEADrequests (#734)
fixed: Fix wrong
content-lengthforHEADrequests to endpoints that returns chunkedresponses (#755)
fixed: Fixed several routing bugs related to nested "opaque" tower services (i.e.
non-
Routerservices) (#841 and #842)changed: Update to tokio-tungstenite 0.17 (#791)
breaking:
Redirect::{to, temporary, permanent}now accept&strinsteadof
Uri(#889)breaking: Remove second type parameter from
Router::into_make_service_with_connect_infoand
Handler::into_make_service_with_connect_infoto supportMakeServicesthat accept multiple targets (#892)
v0.4.8Compare Source
v0.4.7Compare Source
tower::LayerforExtension(#801)AddExtensionLayer. UseExtensioninstead (#805)v0.4.6Compare Source
middleware::from_fnfor creating middleware from async functions.This previously lived in axum-extra but has been moved to axum (#719)
Allowheader when responding with405 Method Not Allowed(#733)v0.4.5Compare Source
axum-macros and is deprecated (#738)
v0.4.4Compare Source
Routers at/(#691)nest("", service)work and mean the same asnest("/", service)(#691)301with308for trailing slash redirects. Also deprecatesRedirect::found(302) in favor ofRedirect::temporary(307) orRedirect::to(303).This is to prevent clients from changing non-
GETrequests toGETrequests (#682)v0.4.3Compare Source
See the CHANGELOG for release notes.
v0.4.2Compare Source
See the CHANGELOG for release notes.
v0.4.1Compare Source
See the CHANGELOG for release notes.
Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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 Renovate Bot.
24622c152ato94ddc79f9994ddc79f99to2ed2255653Update Rust crate axum to 0.5to Update Rust crate axum to 0.5 - autoclosedPull request closed