Skip to content

Releases: tokio-rs/axum

axum-core - v0.2.3

26 Apr 14:39
0702c59
Compare
Choose a tag to compare
  • added: Add response::ErrorResponse and response::Result for
    IntoResponse-based error handling (#921)

axum - v0.5.3

19 Apr 15:02
061e66c
Compare
Choose a tag to compare
  • added: Add AppendHeaders for appending headers to a response rather than overriding them (#927)
  • added: Add axum::extract::multipart::Field::chunk method for streaming a single chunk from
    the field (#901)
  • fixed: Fix trailing slash redirection with query parameters (#936)

axum - v0.5.2

19 Apr 14:20
Compare
Choose a tag to compare

Yanked, as it contained an accidental breaking change.

axum-core - v0.2.2

19 Apr 14:19
Compare
Choose a tag to compare
  • added: Add AppendHeaders for appending headers to a response rather than overriding them (#927)

axum - v0.5.1

03 Apr 18:24
Compare
Choose a tag to compare
  • added: Add RequestParts::extract which allows applying an extractor as a method call ([#897)

axum-extra - v0.2.1

03 Apr 18:19
Compare
Choose a tag to compare
  • added: Re-export SameSite and Expiration from the cookie crate (#898)
  • added: Add PrivateCookieJar for managing private cookies (#900)
  • added: Add SpaRouter for routing setups commonly used for single page applications (#904)
  • fixed: Fix SignedCookieJar when using custom key types (#899)

axum-core - v0.2.1

03 Apr 18:22
Compare
Choose a tag to compare
  • added: Add RequestParts::extract which allows applying an extractor as a method call (#897)

axum - v0.5.0

31 Mar 19:08
Compare
Choose a tag to compare
  • added: Document sharing state between handler and middleware (#783)

  • added: Extension<_> can now be used in tuples for building responses, and will set an
    extension on the response (#797)

  • added: extract::Host for extracting the hostname of a request (#827)

  • added: Add IntoResponseParts trait which allows defining custom response
    types for adding headers or extensions to responses (#797)

  • added: TypedHeader implements the new IntoResponseParts trait so they
    can be returned from handlers as parts of a response (#797)

  • changed: Router::merge now accepts Into<Router> (#819)

  • breaking: sse::Event now accepts types implementing AsRef<str> instead of Into<String>
    as field values.

  • breaking: sse::Event now panics if a setter method is called twice instead of silently
    overwriting old values.

  • breaking: Require Output = () on WebSocketStream::on_upgrade (#644)

  • breaking: Make TypedHeaderRejectionReason #[non_exhaustive] (#665)

  • breaking: Using HeaderMap as an extractor will no longer remove the headers and thus
    they'll still be accessible to other extractors, such as axum::extract::Json. Instead
    HeaderMap will clone the headers. You should prefer to use TypedHeader to extract only the
    headers 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.
    • The HeadersAlreadyExtracted variant has been removed from these rejections:
      • RequestAlreadyExtracted
      • RequestPartsAlreadyExtracted
      • JsonRejection
      • FormRejection
      • ContentLengthLimitRejection
      • WebSocketUpgradeRejection
    • <HeaderMap as FromRequest<_>>::Rejection has been changed to std::convert::Infallible.
  • breaking: axum::http::Extensions is no longer an extractor (ie it
    doesn't implement FromRequest). The axum::extract::Extension extractor is
    not 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 now BodyAlreadyExtracted.
    • <http::request::Parts as FromRequest>::Rejection is now Infallible.
    • ExtensionsAlreadyExtracted has been removed.
    • The 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. Use Extension instead. It now implements
    tower::Layer (#807)

  • breaking: AddExtension has been moved from the root module to middleware

  • breaking: .nest("/foo/", Router::new().route("/bar", _)) now does the right thing and
    results in a route at /foo/bar instead of /foo//bar (#824)

  • breaking: Routes are now required to start with /. Previously routes such as :foo would
    be accepted but most likely result in bugs (#823)

  • breaking: Headers has been removed. Arrays of tuples directly implement
    IntoResponseParts so ([("x-foo", "foo")], response) now works (#797)

  • breaking: InvalidJsonBody has been replaced with JsonDataError to clearly signal that the
    request 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 an
    associated Future type. That allows users to build their own Handler types
    without paying the cost of #[async_trait] (#879)

  • changed: New JsonSyntaxError variant added to JsonRejection. This is returned when the
    request body contains syntactically invalid JSON

  • fixed: Correctly set the Content-Length header for response to HEAD
    requests (#734)

  • fixed: Fix wrong content-length for HEAD requests to endpoints that returns chunked
    responses (#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 instead
    of Uri (#889)

  • breaking: Remove second type parameter from Router::into_make_service_with_connect_info
    and Handler::into_make_service_with_connect_info to support MakeServices
    that accept multiple targets (#892)

axum-macros - v0.2.0

31 Mar 19:08
Compare
Choose a tag to compare
  • breaking: Routes are now required to start with /. Previously empty routes or routes such
    as :foo would be accepted but most likely result in bugs (#823)

axum-extra - v0.2.0

31 Mar 19:08
Compare
Choose a tag to compare
  • added: Add TypedPath::to_uri for converting the path into a Uri (#790)
  • added: Extractors and responses for dealing with cookies. See extract::cookies for more
    details (#816)
  • breaking: CachedRejection has been removed (#699)
  • breaking: <Cached<T> as FromRequest>::Rejection is now T::Rejection. (#699)
  • breaking: middleware::from_fn has been remove from axum-extra and moved into the main
    axum crate (#719)
  • breaking: HasRoutes has been removed. Router::merge now accepts Into<Router> (#819)
  • breaking: RouterExt::with method has been removed. Use Router::merge instead. It works
    identically (#819)