2021-11-30 14:46:13 +01:00
|
|
|
# Changelog
|
|
|
|
|
|
|
|
All notable changes to this project will be documented in this file.
|
|
|
|
|
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
|
|
|
|
|
# Unreleased
|
|
|
|
|
2023-11-27 09:30:38 +01:00
|
|
|
- None.
|
|
|
|
|
|
|
|
# 0.4.0 (27. November, 2023)
|
|
|
|
|
2023-11-25 20:44:07 +01:00
|
|
|
- **added:** Implement `IntoResponse` for `(R,) where R: IntoResponse` ([#2143])
|
|
|
|
- **fixed:** Fix broken docs links ([#2164])
|
|
|
|
- **fixed:** Clearly document applying `DefaultBodyLimit` to individual routes ([#2157])
|
2023-11-27 09:30:38 +01:00
|
|
|
- **breaking:** The following types/traits are no longer generic over the request body
|
|
|
|
(i.e. the `B` type param has been removed) ([#1751] and [#1789]):
|
|
|
|
- `FromRequestParts`
|
|
|
|
- `FromRequest`
|
|
|
|
- `RequestExt`
|
|
|
|
- **breaking:** axum no longer re-exports `hyper::Body` as that type is removed
|
|
|
|
in hyper 1.0. Instead axum has its own body type at `axum_core::body::Body` ([#1751])
|
2023-11-25 20:44:07 +01:00
|
|
|
|
|
|
|
[#2143]: https://github.com/tokio-rs/axum/pull/2143
|
|
|
|
[#2164]: https://github.com/tokio-rs/axum/pull/2164
|
|
|
|
[#2157]: https://github.com/tokio-rs/axum/pull/2157
|
2023-03-03 18:16:24 +01:00
|
|
|
|
2023-04-11 17:23:38 +02:00
|
|
|
# 0.3.4 (11. April, 2023)
|
|
|
|
|
|
|
|
- Changes to private APIs.
|
|
|
|
|
2023-03-03 18:16:24 +01:00
|
|
|
# 0.3.3 (03. March, 2023)
|
|
|
|
|
2023-03-03 14:12:35 +01:00
|
|
|
- **fixed:** Add `#[must_use]` attributes to types that do nothing unless used ([#1809])
|
|
|
|
|
|
|
|
[#1809]: https://github.com/tokio-rs/axum/pull/1809
|
2023-01-20 23:51:19 +01:00
|
|
|
|
|
|
|
# 0.3.2 (20. January, 2023)
|
|
|
|
|
2023-01-13 11:54:30 +01:00
|
|
|
- **added:** Implement `IntoResponse` for `&'static [u8; N]` and `[u8; N]` ([#1690])
|
2023-01-13 10:12:51 +01:00
|
|
|
|
|
|
|
[#1690]: https://github.com/tokio-rs/axum/pull/1690
|
2023-01-09 13:54:49 +01:00
|
|
|
|
|
|
|
# 0.3.1 (9. January, 2023)
|
|
|
|
|
2022-12-02 19:54:16 +01:00
|
|
|
- **added:** Add `body_text` and `status` methods to built-in rejections ([#1612])
|
|
|
|
|
|
|
|
[#1612]: https://github.com/tokio-rs/axum/pull/1612
|
2022-11-09 09:01:47 +01:00
|
|
|
|
2022-11-25 13:29:58 +01:00
|
|
|
# 0.3.0 (25. November, 2022)
|
|
|
|
|
|
|
|
- **added:** Added new `FromRequestParts` trait. See axum's changelog for more
|
|
|
|
details ([#1272])
|
|
|
|
- **breaking:** `FromRequest` has been reworked and `RequestParts` has been
|
|
|
|
removed. See axum's changelog for more details ([#1272])
|
|
|
|
- **breaking:** `BodyAlreadyExtracted` has been removed ([#1272])
|
|
|
|
- **breaking:** `AppendHeaders` now works on any `impl IntoIterator` ([#1495])
|
|
|
|
|
|
|
|
[#1272]: https://github.com/tokio-rs/axum/pull/1272
|
|
|
|
[#1495]: https://github.com/tokio-rs/axum/pull/1495
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary>0.3.0 Pre-Releases</summary>
|
|
|
|
|
2022-11-09 09:01:47 +01:00
|
|
|
# 0.3.0-rc.3 (8. November, 2022)
|
|
|
|
|
2022-09-19 22:41:54 +02:00
|
|
|
- **added:** Add `DefaultBodyLimit::max` for changing the default body limit ([#1397])
|
2022-10-13 11:44:54 +02:00
|
|
|
- **added:** Add `Error::into_inner` for converting `Error` to `BoxError` without allocating ([#1476])
|
2022-10-20 21:05:04 +02:00
|
|
|
- **breaking:** `AppendHeaders` now works on any `impl IntoIterator` ([#1495])
|
2022-09-19 22:41:54 +02:00
|
|
|
|
|
|
|
[#1397]: https://github.com/tokio-rs/axum/pull/1397
|
2022-10-13 11:44:54 +02:00
|
|
|
[#1476]: https://github.com/tokio-rs/axum/pull/1476
|
2022-10-20 21:05:04 +02:00
|
|
|
[#1495]: https://github.com/tokio-rs/axum/pull/1495
|
2022-09-11 16:42:04 +02:00
|
|
|
|
|
|
|
# 0.3.0-rc.2 (10. September, 2022)
|
|
|
|
|
2022-09-10 08:36:30 +02:00
|
|
|
- **breaking:** Added default limit to how much data `Bytes::from_request` will
|
|
|
|
consume. Previously it would attempt to consume the entire request body
|
|
|
|
without checking its length. This meant if a malicious peer sent an large (or
|
|
|
|
infinite) request body your server might run out of memory and crash.
|
|
|
|
|
|
|
|
The default limit is at 2 MB and can be disabled by adding the new
|
|
|
|
`DefaultBodyLimit::disable()` middleware. See its documentation for more
|
|
|
|
details.
|
|
|
|
|
|
|
|
This also applies to `String` which used `Bytes::from_request` internally.
|
|
|
|
|
|
|
|
([#1346])
|
|
|
|
|
|
|
|
[#1346]: https://github.com/tokio-rs/axum/pull/1346
|
2022-08-23 22:57:13 +02:00
|
|
|
|
|
|
|
# 0.3.0-rc.1 (23. August, 2022)
|
|
|
|
|
2022-08-22 12:23:20 +02:00
|
|
|
- **breaking:** `FromRequest` has been reworked and `RequestParts` has been
|
|
|
|
removed. See axum's changelog for more details ([#1272])
|
|
|
|
- **added:** Added new `FromRequestParts` trait. See axum's changelog for more
|
|
|
|
details ([#1272])
|
|
|
|
- **breaking:** `BodyAlreadyExtracted` has been removed ([#1272])
|
2022-08-17 17:13:31 +02:00
|
|
|
|
|
|
|
[#1155]: https://github.com/tokio-rs/axum/pull/1155
|
2022-08-22 12:23:20 +02:00
|
|
|
[#1272]: https://github.com/tokio-rs/axum/pull/1272
|
2022-06-18 11:00:19 +02:00
|
|
|
|
2022-11-25 13:29:58 +01:00
|
|
|
</details>
|
|
|
|
|
2022-10-10 20:22:24 +02:00
|
|
|
# 0.2.8 (10. September, 2022)
|
|
|
|
|
|
|
|
- **breaking:** Added default limit to how much data `Bytes::from_request` will
|
|
|
|
consume. Previously it would attempt to consume the entire request body
|
|
|
|
without checking its length. This meant if a malicious peer sent an large (or
|
|
|
|
infinite) request body your server might run out of memory and crash.
|
|
|
|
|
|
|
|
The default limit is at 2 MB and can be disabled by adding the new
|
|
|
|
`DefaultBodyLimit::disable()` middleware. See its documentation for more
|
|
|
|
details.
|
|
|
|
|
|
|
|
This also applies to `String` which used `Bytes::from_request` internally.
|
|
|
|
|
|
|
|
([#1346])
|
|
|
|
|
|
|
|
[#1346]: https://github.com/tokio-rs/axum/pull/1346
|
|
|
|
|
2022-08-20 21:11:02 +02:00
|
|
|
# 0.2.7 (10. July, 2022)
|
|
|
|
|
|
|
|
- **fix:** Fix typos in `RequestParts` docs ([#1147])
|
|
|
|
|
|
|
|
[#1147]: https://github.com/tokio-rs/axum/pull/1147
|
|
|
|
|
2022-06-18 11:38:52 +02:00
|
|
|
# 0.2.6 (18. June, 2022)
|
2022-06-18 11:00:19 +02:00
|
|
|
|
|
|
|
- **change:** axum-core's MSRV is now 1.56 ([#1098])
|
2022-06-17 20:11:35 +02:00
|
|
|
|
|
|
|
[#1098]: https://github.com/tokio-rs/axum/pull/1098
|
2022-06-08 15:56:56 +02:00
|
|
|
|
|
|
|
# 0.2.5 (08. June, 2022)
|
|
|
|
|
2022-06-08 15:47:57 +02:00
|
|
|
- **added:** Automatically handle `http_body::LengthLimitError` in `FailedToBufferBody` and map
|
|
|
|
such errors to `413 Payload Too Large` ([#1048])
|
2022-06-06 18:00:52 +02:00
|
|
|
- **fixed:** Use `impl IntoResponse` less in docs ([#1049])
|
|
|
|
|
2022-06-08 15:47:57 +02:00
|
|
|
[#1048]: https://github.com/tokio-rs/axum/pull/1048
|
2022-06-06 18:00:52 +02:00
|
|
|
[#1049]: https://github.com/tokio-rs/axum/pull/1049
|
2022-05-02 11:52:24 +02:00
|
|
|
|
|
|
|
# 0.2.4 (02. May, 2022)
|
|
|
|
|
2022-04-29 17:28:24 +02:00
|
|
|
- **added:** Implement `IntoResponse` and `IntoResponseParts` for `http::Extensions` ([#975])
|
2022-04-29 17:52:21 +02:00
|
|
|
- **added:** Implement `IntoResponse` for `(http::response::Parts, impl IntoResponse)` ([#950])
|
|
|
|
- **added:** Implement `IntoResponse` for `(http::response::Response<()>, impl IntoResponse)` ([#950])
|
2022-04-29 22:08:47 +02:00
|
|
|
- **added:** Implement `IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse)` ([#980])
|
2022-04-29 17:28:24 +02:00
|
|
|
|
2022-04-29 17:52:21 +02:00
|
|
|
[#950]: https://github.com/tokio-rs/axum/pull/950
|
2022-04-29 17:28:24 +02:00
|
|
|
[#975]: https://github.com/tokio-rs/axum/pull/975
|
2022-04-29 22:08:47 +02:00
|
|
|
[#980]: https://github.com/tokio-rs/axum/pull/980
|
2022-04-26 16:19:47 +02:00
|
|
|
|
|
|
|
# 0.2.3 (25. April, 2022)
|
|
|
|
|
2022-04-21 16:24:29 +02:00
|
|
|
- **added:** Add `response::ErrorResponse` and `response::Result` for
|
|
|
|
`IntoResponse`-based error handling ([#921])
|
|
|
|
|
2023-01-13 10:12:51 +01:00
|
|
|
[#921]: https://github.com/tokio-rs/axum/pull/921
|
2022-04-19 16:17:52 +02:00
|
|
|
|
|
|
|
# 0.2.2 (19. April, 2022)
|
|
|
|
|
2022-04-17 23:14:04 +02:00
|
|
|
- **added:** Add `AppendHeaders` for appending headers to a response rather than overriding them ([#927])
|
|
|
|
|
|
|
|
[#927]: https://github.com/tokio-rs/axum/pull/927
|
2022-04-03 20:21:16 +02:00
|
|
|
|
|
|
|
# 0.2.1 (03. April, 2022)
|
|
|
|
|
|
|
|
- **added:** Add `RequestParts::extract` which allows applying an extractor as a method call ([#897])
|
|
|
|
|
|
|
|
[#897]: https://github.com/tokio-rs/axum/pull/897
|
2022-03-31 20:36:12 +02:00
|
|
|
|
|
|
|
# 0.2.0 (31. March, 2022)
|
|
|
|
|
2022-03-09 16:07:41 +01:00
|
|
|
- **added:** Add `IntoResponseParts` trait which allows defining custom response
|
|
|
|
types for adding headers or extensions to responses ([#797])
|
2022-01-11 20:39:39 +01:00
|
|
|
- **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`
|
2022-01-25 09:46:26 +01:00
|
|
|
- `<HeaderMap as FromRequest<_>>::Rejection` has been changed to `std::convert::Infallible`.
|
2022-01-13 09:49:55 +01:00
|
|
|
- **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.
|
2022-01-25 09:46:26 +01:00
|
|
|
- `<Request as FromRequest>::Rejection` is now `BodyAlreadyExtracted`.
|
|
|
|
- `<http::request::Parts as FromRequest>::Rejection` is now `Infallible`.
|
2022-01-13 09:49:55 +01:00
|
|
|
- `ExtensionsAlreadyExtracted` has been removed.
|
2022-03-18 16:39:13 +01:00
|
|
|
- **breaking:** `RequestParts::body_mut` now returns `&mut Option<B>` so the
|
|
|
|
body can be swapped ([#869])
|
2022-01-11 20:39:39 +01:00
|
|
|
|
|
|
|
[#698]: https://github.com/tokio-rs/axum/pull/698
|
2022-01-13 09:49:55 +01:00
|
|
|
[#699]: https://github.com/tokio-rs/axum/pull/699
|
2022-03-01 00:04:33 +01:00
|
|
|
[#797]: https://github.com/tokio-rs/axum/pull/797
|
2022-03-18 16:39:13 +01:00
|
|
|
[#869]: https://github.com/tokio-rs/axum/pull/869
|
2021-12-02 20:02:38 +01:00
|
|
|
|
2022-03-31 20:21:55 +02:00
|
|
|
# 0.1.2 (22. February, 2022)
|
|
|
|
|
|
|
|
- **added:** Implement `IntoResponse` for `bytes::BytesMut` and `bytes::Chain<T, U>` ([#767])
|
|
|
|
|
|
|
|
[#767]: https://github.com/tokio-rs/axum/pull/767
|
|
|
|
|
2021-12-06 10:30:09 +01:00
|
|
|
# 0.1.1 (06. December, 2021)
|
|
|
|
|
2021-12-06 13:03:13 +01:00
|
|
|
- **added:** `axum_core::response::Response` now exists as a shorthand for writing `Response<BoxBody>` ([#590])
|
|
|
|
|
|
|
|
[#590]: https://github.com/tokio-rs/axum/pull/590
|
2021-12-06 10:30:09 +01:00
|
|
|
|
2021-12-02 20:02:38 +01:00
|
|
|
# 0.1.0 (02. December, 2021)
|
|
|
|
|
|
|
|
- Initial release.
|