Commit Graph
796 Commits
Author SHA1 Message Date
David Mládek b9e35ec780 Split examples & check minimum versions (#3370)
Currently, both cargo deny and our MSRV checks use Cargo.lock file which has unified features and versions across both the axum crates and all the examples. This can hide some issues as usually when someone adds an example, they might use cargo add which will silently update the dependency for the whole repository. Some compilation errors (like axum requiring [email protected] while it uses features from [email protected]) will then be hidden.

I don't think most users would ever need to use the minimal versions anyway so this is not as severe, but someone might run into compilation errors.
2025-12-02 22:24:37 +01:00
Mohamed Macow 7fd17ceba5 docs: Clarify route_layer does not apply middleware to the fallback handler (#3567) 2025-11-21 23:17:24 +01:00
Ivan Tham 26367b9f1e axum: use Vec for PathRouter (#3509) 2025-11-21 17:09:18 +01:00
Jonas Platte b1ef45469b Merge branch 'v0.8.x' into jplatte/v0.8.7 2025-11-14 20:46:08 +01:00
Jonas Platte 4404f27cea Release axum v0.8.7 and axum-extra v0.12.2 2025-11-14 20:44:55 +01:00
Andrii Mishkovskyi 8f1545adec Fix typo in extractors guide (#3554) 2025-11-14 20:42:06 +01:00
Jonas Platte 4fc3faa0b4 Relax implicit Send / Sync bounds (#3555) 2025-11-14 20:41:03 +01:00
Lyra Naeseth a05920c906 Make it easier to visually scan for default features (#3550) 2025-11-14 20:39:44 +01:00
Italo Maia fe607e6dcf Fixes wording typo (#3540) 2025-11-14 20:37:15 +01:00
Jonas Platte c10934c79c Relax implicit Send / Sync bounds (#3555) 2025-11-14 10:48:07 +01:00
Andrii Mishkovskyi 830a114172 Fix typo in extractors guide (#3554) 2025-11-13 09:47:58 +01:00
Lyra Naeseth 3ef6c5d183 Make it easier to visually scan for default features (#3550) 2025-11-10 10:41:04 +01:00
Italo Maia c4890b844b Fixes wording typo (#3540) 2025-10-26 23:35:01 +01:00
Pavel Borzenkov 86e4442888 axum: Bump 'bytes' dependency to 1.7 (#3513) 2025-10-01 11:39:23 +02:00
David Mládek d8cd5cec4b Merge remote-tracking branch 'origin/v0.8.x' into mladedav/v0.8.6 2025-09-30 14:29:20 +02:00
David Mládek c1bb9c3e90 Release axum 0.8.6 and related crates 2025-09-30 12:03:26 +02:00
David Mládek 4a50581968 Update changelogs 2025-09-30 12:00:20 +02:00
David Mládek 5c76cfd26a Remove usage of the doc_auto_cfg feature (#3505) 2025-09-30 11:55:34 +02:00
David Mládek 6cea3eadee Remove usage of the doc_auto_cfg feature (#3505) 2025-09-30 11:53:30 +02:00
Jonas Platte f791ec3879 Merge branch 'v0.8.x' into jplatte/v0.8.5 2025-09-28 20:46:41 +02:00
Jonas Platte a1d22f68a5 Release axum 0.8.5 and related crates 2025-09-28 20:46:16 +02:00
Jonas Platte ad2fd5b50b Update changelogs 2025-09-28 20:26:09 +02:00
Antoine Vandecreme a0692f9f54 Reject JSON bodies with trailing chars (#3453) 2025-09-28 20:25:54 +02:00
Jonas Platte 651cc1e935 Remove unused link def 2025-09-28 19:37:31 +02:00
tottoto cb8670a94b Update to tokio-tungstenite 0.28 (#3497) 2025-09-28 19:31:58 +02:00
Fredrik Park 6f1ed5e0a0 Spelling misstake in Using closure capture (#3481) 2025-09-28 19:30:18 +02:00
221ef3795b websocket: add a wrapper around is_terminated (#3443)
Co-authored-by: Loic <[email protected]>
Co-authored-by: loikki <[email protected]>
2025-09-28 19:30:07 +02:00
David Mládek d108c50ce7 axum: add ResponseAxumBodyLayer for mapping response body to axum::body::Body 2025-09-28 19:28:47 +02:00
Jonas Platte 16534439f5 Switch serde dependency to serde_core (#3477) 2025-09-28 19:28:32 +02:00
Niclas Klugmann c40f739cdf Clarify that AddExtension is not the actual Layer (#3463) 2025-09-28 19:25:37 +02:00
reivilibre b8ae30747c Document type parameter T on Handler (#3435)
Signed-off-by: Olivier 'reivilibre <[email protected]>
2025-09-28 19:24:04 +02:00
Glen De Cauwsemaecker eb3c5418ef Support custom (binary) data to be written into SSE Event (#3425) 2025-09-28 19:24:00 +02:00
Glen De Cauwsemaecker d88b39897b Fix ci failures (#3432) 2025-09-28 19:22:35 +02:00
Jan Runge f736e9f24e Extractors doc: correct linked example section (#3349) 2025-09-28 19:22:10 +02:00
Jonas Platte 25549f0ba2 Update minimum Rust version to 1.78 (#3412) 2025-09-28 19:22:01 +02:00
Glen De Cauwsemaecker c1ff1539e3 sse: Add space between duration and : (#3403) 2025-09-28 19:20:22 +02:00
Theodore BjernhedandTheodore Bjernhed 384f393857 Add #[must_use] to types and methods (#3395)
Co-authored-by: Theodore Bjernhed <[email protected]>
2025-09-28 19:19:54 +02:00
tottoto 3a18eb6108 Update tokio-tungstenite to 0.27 (#3398) 2025-09-28 19:19:33 +02:00
zeon d0d8088be1 New redirect inspection (#3377) 2025-09-28 19:18:22 +02:00
Jake McGinty f32223b2e9 Implement OptionalFromRequest for Multipart (#3220) 2025-09-28 19:17:02 +02:00
Nano abe98474e1 Make SSE less dependent on tokio (#3154) 2025-09-28 19:12:15 +02:00
tottoto bf9b43cabe Update to tokio-tungstenite 0.28 (#3497) 2025-09-25 22:09:35 +09:00
Søren Løvborg 9ed1ad69d2 axum: add ListenerExt::limit_connections (#3489) 2025-09-23 23:25:36 +02:00
tottoto 50f0082970 axum: Make futures-sink optional dependency (#3491) 2025-09-22 23:58:30 +09:00
Fredrik Park 600b16d431 Spelling misstake in Using closure capture (#3481) 2025-09-16 22:33:39 +02:00
e43030d051 websocket: add a wrapper around is_terminated (#3443)
Co-authored-by: Loic <[email protected]>
Co-authored-by: loikki <[email protected]>
2025-09-16 15:54:44 +00:00
othelot ab593bbab7 routing: omit the Allow header for non-405 method not allowed fallbacks (#3465) 2025-09-16 08:29:01 +00:00
Søren Løvborg 1073468163 axum::serve: Enable Hyper request header timeout (#3478)
It's possible for an HTTP request to get stuck (due to network issues or
malicious clients) halfway through the request line or header, in which
case no amount of timeouts configured by an application using axum/tower
will help, since Hyper hasn't yet handed off the request to the service.

This has two consequences:

- Wasted memory: Up to ~1 MB per connection in the worst case, compared
  to the ~2.5 kB used by a regular idle connection.

- A `with_graceful_shutdown` signal will cause the server to stop
  accepting new requests, but then hang instead of actually stopping.

This changes axum::serve to configure a Timer for HTTP/1 connections,
which activates Hyper's default timeout (currently 30 seconds).

The timeout applies only to the request line and request header, not the
request body or subsequent response (where axum applications can instead
simply configure a timeout using `tower_http::timeout::TimeoutLayer`).

The timeout does not currently apply to newly opened connections, even
though Hyper's `header_read_timeout` SHOULD apply here too since 1.4.0;
discussion on tokio-rs#2741 suggests a possible TokioIo issue. However, the
graceful shutdown still works as expected for such connections.

The timer is only enabled for HTTP/1 here since similar functionality
does not currently appear to exist for HTTP/2 connections in Hyper.

This is a breaking change for any axum::serve users who currently rely
on being able to begin sending a HTTP/1 request, and then take more than
30 seconds to finish the request line and headers, or rely on keeping
connections idle for 30+ seconds between requests.
2025-09-16 10:19:20 +02:00
David Mládek 853d7e707a axum: add ResponseAxumBodyLayer for mapping response body to axum::body::Body 2025-09-14 19:50:04 +02:00
Jonas Platte 4ab8df5e42 Switch serde dependency to serde_core (#3477) 2025-09-14 08:49:07 +02:00