Update Rust crate axum to 0.5 - autoclosed #5
Loading…
Reference in New Issue
Block a user
No description provided.
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.5
Release 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)
Multipart
extractor work withRequestBodyLimit
middleware (#1379)DefaultBodyLimit::max
for changing the default body limit (#1397)v0.5.16
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
Note: This is a re-release of 0.5.14 that fixes an accidental breaking change.
QueryRejection
response. (#1171)v0.5.14
Yanked, as it contained an accidental breaking change.
v0.5.13
WebSocketUpgrade
cannot upgrade the connection it will return aWebSocketUpgradeRejection::ConnectionNotUpgradable
rejection (#1135)WebSocketUpgradeRejection
has a new variantConnectionNotUpgradable
variant (#1135)
v0.5.12
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
TryFrom<http:: Method>
forMethodFilter
and use newNoMatchingMethodFilter
error in case of failure (#1130)v0.5.10
Router
cheaper to clone (#1123)v0.5.9
headers
is enabled and theform
feature is disabled (#1107)
v0.5.8
Forwarded
header inHost
extractor (#1078)
IntoResponse
forForm
(#1095)v0.5.7
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
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
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
response::ErrorResponse
andresponse::Result
forIntoResponse
-based error handling (#921)middleware::from_extractor
and deprecateextract::extractor_middleware
(#957)v0.5.3
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
Yanked, as it contained an accidental breaking change.
v0.5.1
Compare Source
RequestParts::extract
which allows applying an extractor as a method call ([#897)v0.5.0
Compare 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::Host
for extracting the hostname of a request (#827)added: Add
IntoResponseParts
trait which allows defining custom responsetypes for adding headers or extensions to responses (#797)
added:
TypedHeader
implements the newIntoResponseParts
trait so theycan be returned from handlers as parts of a response (#797)
changed:
Router::merge
now acceptsInto<Router>
(#819)breaking:
sse::Event
now accepts types implementingAsRef<str>
instead ofInto<String>
as field values.
breaking:
sse::Event
now 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
HeaderMap
as an extractor will no longer remove the headers and thusthey'll still be accessible to other extractors, such as
axum::extract::Json
. InsteadHeaderMap
will clone the headers. You should prefer to useTypedHeader
to extract only theheaders you need (#698)
This includes these breaking changes:
RequestParts::take_headers
has been removed.RequestParts::headers
returns&HeaderMap
.RequestParts::headers_mut
returns&mut HeaderMap
.HeadersAlreadyExtracted
has been removed.HeadersAlreadyExtracted
variant has been removed from these rejections:RequestAlreadyExtracted
RequestPartsAlreadyExtracted
JsonRejection
FormRejection
ContentLengthLimitRejection
WebSocketUpgradeRejection
<HeaderMap as FromRequest<_>>::Rejection
has been changed tostd::convert::Infallible
.breaking:
axum::http::Extensions
is no longer an extractor (ie itdoesn't implement
FromRequest
). Theaxum::extract::Extension
extractor 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_extensions
has been removed.RequestParts::extensions
returns&Extensions
.RequestParts::extensions_mut
returns&mut Extensions
.RequestAlreadyExtracted
has been removed.<Request as FromRequest>::Rejection
is nowBodyAlreadyExtracted
.<http::request::Parts as FromRequest>::Rejection
is nowInfallible
.ExtensionsAlreadyExtracted
has been removed.ExtensionsAlreadyExtracted
removed variant has been removed from these rejections:ExtensionRejection
PathRejection
MatchedPathRejection
WebSocketUpgradeRejection
breaking:
Redirect::found
has been removed (#800)breaking:
AddExtensionLayer
has been removed. UseExtension
instead. It now implementstower::Layer
(#807)breaking:
AddExtension
has been moved from the root module tomiddleware
breaking:
.nest("/foo/", Router::new().route("/bar", _))
now does the right thing andresults in a route at
/foo/bar
instead of/foo//bar
(#824)breaking: Routes are now required to start with
/
. Previously routes such as:foo
wouldbe accepted but most likely result in bugs (#823)
breaking:
Headers
has been removed. Arrays of tuples directly implementIntoResponseParts
so([("x-foo", "foo")], response)
now works (#797)breaking:
InvalidJsonBody
has been replaced withJsonDataError
to clearly signal that therequest body was syntactically valid JSON but couldn't be deserialized into the target type
breaking:
Handler
is no longer an#[async_trait]
but instead has anassociated
Future
type. That allows users to build their ownHandler
typeswithout paying the cost of
#[async_trait]
(#879)changed: New
JsonSyntaxError
variant added toJsonRejection
. This is returned when therequest body contains syntactically invalid JSON
fixed: Correctly set the
Content-Length
header for response toHEAD
requests (#734)
fixed: Fix wrong
content-length
forHEAD
requests to endpoints that returns chunkedresponses (#755)
fixed: Fixed several routing bugs related to nested "opaque" tower services (i.e.
non-
Router
services) (#841 and #842)changed: Update to tokio-tungstenite 0.17 (#791)
breaking:
Redirect::{to, temporary, permanent}
now accept&str
insteadof
Uri
(#889)breaking: Remove second type parameter from
Router::into_make_service_with_connect_info
and
Handler::into_make_service_with_connect_info
to supportMakeService
sthat accept multiple targets (#892)
v0.4.8
Compare Source
v0.4.7
Compare Source
tower::Layer
forExtension
(#801)AddExtensionLayer
. UseExtension
instead (#805)v0.4.6
Compare Source
middleware::from_fn
for creating middleware from async functions.This previously lived in axum-extra but has been moved to axum (#719)
Allow
header when responding with405 Method Not Allowed
(#733)v0.4.5
Compare Source
axum-macros and is deprecated (#738)
v0.4.4
Compare Source
Router
s at/
(#691)nest("", service)
work and mean the same asnest("/", service)
(#691)301
with308
for trailing slash redirects. Also deprecatesRedirect::found
(302
) in favor ofRedirect::temporary
(307
) orRedirect::to
(303
).This is to prevent clients from changing non-
GET
requests toGET
requests (#682)v0.4.3
Compare Source
See the CHANGELOG for release notes.
v0.4.2
Compare Source
See the CHANGELOG for release notes.
v0.4.1
Compare 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.
24622c152a
to94ddc79f99
94ddc79f99
to2ed2255653
Update Rust crate axum to 0.5to Update Rust crate axum to 0.5 - autoclosedPull request closed