From d46e0fc99c92a6b673bff307451f86a6914fe9d8 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Tue, 26 May 2026 11:53:37 -0500 Subject: [PATCH] docs(axum): add changelog entry; gate `TokioTimer` import to http1 Add the CHANGELOG entry for `ConnectionLimits` (#3779), and gate the `TokioTimer` import under `feature = "http1"` since it is only used there, fixing a pre-existing unused-import warning in http2-only builds. Co-Authored-By: Claude Opus 4.7 (1M context) --- axum/CHANGELOG.md | 4 ++++ axum/src/serve/mod.rs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index ca9099fd..97bc2fc4 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **added:** `IntoResponseParts` impl for `Redirect`, allowing it to be combined with a body in a response tuple ([#3721]) - **added:** Add `RawPathParams::from_request_extensions` ([#3757]) +- **added:** `serve::ConnectionLimits` and `Serve::connection_limits` for bounding the lifetime of + individual connections (`max_connection_age`, `max_connection_age_jitter`, + `max_connection_age_grace`), forcing clients to rotate connections ([#3779]) - **changed:** `serve` has an additional generic argument and can now work with any response body type, not just `axum::body::Body` ([#3205]) - **changed:** `Redirect` constructors now accept any `impl Into` ([#3635]) @@ -39,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#3721]: https://github.com/tokio-rs/axum/pull/3721 [#3742]: https://github.com/tokio-rs/axum/pull/3742 [#3757]: https://github.com/tokio-rs/axum/pull/3757 +[#3779]: https://github.com/tokio-rs/axum/pull/3779 # 0.8.9 diff --git a/axum/src/serve/mod.rs b/axum/src/serve/mod.rs index 71d481eb..5e9dd489 100644 --- a/axum/src/serve/mod.rs +++ b/axum/src/serve/mod.rs @@ -16,7 +16,9 @@ use axum_core::{body::Body, extract::Request, response::Response}; use futures_util::{future::OptionFuture, FutureExt}; use http_body::Body as HttpBody; use hyper::body::Incoming; -use hyper_util::rt::{TokioIo, TokioTimer}; +use hyper_util::rt::TokioIo; +#[cfg(feature = "http1")] +use hyper_util::rt::TokioTimer; #[cfg(any(feature = "http1", feature = "http2"))] use hyper_util::{server::conn::auto::Builder, service::TowerToHyperService}; use tokio::{sync::watch, task::JoinHandle};