diff --git a/axum-core/CHANGELOG.md b/axum-core/CHANGELOG.md index 374eaf48..2900d593 100644 --- a/axum-core/CHANGELOG.md +++ b/axum-core/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased -- **added:** Add `IntoResponseParts` trait ([#797]) +- **added:** Add `IntoResponseParts` trait which allows defining custom response + types for adding headers or extensions to responses ([#797]) - **added:** Implement `IntoResponse` for `bytes::BytesMut` and `bytes::Chain` ([#767]) - **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 diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 3a7e2253..192a8d89 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 extension on the response ([#797]) - **added:** Implement `tower::Layer` for `Extension` ([#801]) - **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` ([#819]) - **breaking:** `sse::Event` now accepts types implementing `AsRef` instead of `Into` as field values. @@ -65,6 +69,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 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]) - **fixed:** Set `Allow` header when responding with `405 Method Not Allowed` ([#733]) - **fixed:** Correctly set the `Content-Length` header for response to `HEAD` requests ([#734])