From 6b0089190c832f5b8da3cbd3cb737b900bf3f36e Mon Sep 17 00:00:00 2001 From: Jan <59206115+Threated@users.noreply.github.com> Date: Mon, 22 Dec 2025 20:24:59 +0100 Subject: [PATCH 1/2] fix(json-lines): Respect default body limit (#3591) --- axum-extra/CHANGELOG.md | 6 ++++++ axum-extra/src/json_lines.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/axum-extra/CHANGELOG.md b/axum-extra/CHANGELOG.md index 84678f98..c46d7c04 100644 --- a/axum-extra/CHANGELOG.md +++ b/axum-extra/CHANGELOG.md @@ -1,3 +1,9 @@ +# Unreleased + +- **fixed:** `JsonLines` now correctly respects the default body limit ([#3591]) + +[#3591]: https://github.com/tokio-rs/axum/pull/3591 + # Changelog All notable changes to this project will be documented in this file. diff --git a/axum-extra/src/json_lines.rs b/axum-extra/src/json_lines.rs index d9afb044..82bff24d 100644 --- a/axum-extra/src/json_lines.rs +++ b/axum-extra/src/json_lines.rs @@ -4,7 +4,7 @@ use axum_core::{ body::Body, extract::{FromRequest, Request}, response::{IntoResponse, Response}, - BoxError, + BoxError, RequestExt, }; use bytes::{BufMut, BytesMut}; use futures_util::stream::{BoxStream, Stream, TryStream, TryStreamExt}; @@ -108,7 +108,7 @@ where async fn from_request(req: Request, _state: &S) -> Result { // `Stream::lines` isn't a thing so we have to convert it into an `AsyncRead` // so we can call `AsyncRead::lines` and then convert it back to a `Stream` - let body = req.into_body(); + let body = req.into_limited_body(); let stream = body.into_data_stream(); let stream = stream.map_err(io::Error::other); let read = StreamReader::new(stream); From d9f79f56169896cec0fa47619fc40df23585a085 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 27 Dec 2025 15:33:05 +0100 Subject: [PATCH 2/2] Release axum-extra v0.12.5 --- Cargo.lock | 2 +- axum-extra/CHANGELOG.md | 12 ++++++------ axum-extra/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bf108ed..50d551d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "axum-extra" -version = "0.12.4" +version = "0.12.5" dependencies = [ "axum", "axum-core", diff --git a/axum-extra/CHANGELOG.md b/axum-extra/CHANGELOG.md index c46d7c04..f6cddd36 100644 --- a/axum-extra/CHANGELOG.md +++ b/axum-extra/CHANGELOG.md @@ -1,9 +1,3 @@ -# Unreleased - -- **fixed:** `JsonLines` now correctly respects the default body limit ([#3591]) - -[#3591]: https://github.com/tokio-rs/axum/pull/3591 - # Changelog All notable changes to this project will be documented in this file. @@ -11,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning]. +# 0.12.5 + +- **fixed:** `JsonLines` now correctly respects the default body limit ([#3591]) + +[#3591]: https://github.com/tokio-rs/axum/pull/3591 + # 0.12.4 - **changed:** Deprecated the `Host` and `Scheme` extractors ([#3595]) diff --git a/axum-extra/Cargo.toml b/axum-extra/Cargo.toml index e81e187c..c66d1365 100644 --- a/axum-extra/Cargo.toml +++ b/axum-extra/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" name = "axum-extra" readme = "README.md" repository = "https://github.com/tokio-rs/axum" -version = "0.12.4" +version = "0.12.5" [features] default = ["tracing"]