1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8# Unreleased
9
10- None.
11
12# 0.3.4 (11. April, 2023)
13
14- Changes to private APIs.
15
16# 0.3.3 (03. March, 2023)
17
18- **fixed:** Add `#[must_use]` attributes to types that do nothing unless used ([#1809])
19
20[#1809]: https://github.com/tokio-rs/axum/pull/1809
21
22# 0.3.2 (20. January, 2023)
23
24- **added:** Implement `IntoResponse` for `&'static [u8; N]` and `[u8; N]` ([#1690])
25
26[#1690]: https://github.com/tokio-rs/axum/pull/1690
27
28# 0.3.1 (9. January, 2023)
29
30- **added:** Add `body_text` and `status` methods to built-in rejections ([#1612])
31
32[#1612]: https://github.com/tokio-rs/axum/pull/1612
33
34# 0.3.0 (25. November, 2022)
35
36- **added:** Added new `FromRequestParts` trait. See axum's changelog for more
37  details ([#1272])
38- **breaking:** `FromRequest` has been reworked and `RequestParts` has been
39  removed. See axum's changelog for more details ([#1272])
40- **breaking:** `BodyAlreadyExtracted` has been removed ([#1272])
41- **breaking:** `AppendHeaders` now works on any `impl IntoIterator` ([#1495])
42
43[#1272]: https://github.com/tokio-rs/axum/pull/1272
44[#1495]: https://github.com/tokio-rs/axum/pull/1495
45
46<details>
47<summary>0.3.0 Pre-Releases</summary>
48
49# 0.3.0-rc.3 (8. November, 2022)
50
51- **added:** Add `DefaultBodyLimit::max` for changing the default body limit ([#1397])
52- **added:** Add `Error::into_inner` for converting `Error` to `BoxError` without allocating ([#1476])
53- **breaking:** `AppendHeaders` now works on any `impl IntoIterator` ([#1495])
54
55[#1397]: https://github.com/tokio-rs/axum/pull/1397
56[#1476]: https://github.com/tokio-rs/axum/pull/1476
57[#1495]: https://github.com/tokio-rs/axum/pull/1495
58
59# 0.3.0-rc.2 (10. September, 2022)
60
61- **breaking:** Added default limit to how much data `Bytes::from_request` will
62  consume. Previously it would attempt to consume the entire request body
63  without checking its length. This meant if a malicious peer sent an large (or
64  infinite) request body your server might run out of memory and crash.
65
66  The default limit is at 2 MB and can be disabled by adding the new
67  `DefaultBodyLimit::disable()` middleware. See its documentation for more
68  details.
69
70  This also applies to `String` which used `Bytes::from_request` internally.
71
72  ([#1346])
73
74[#1346]: https://github.com/tokio-rs/axum/pull/1346
75
76# 0.3.0-rc.1 (23. August, 2022)
77
78- **breaking:** `FromRequest` has been reworked and `RequestParts` has been
79  removed. See axum's changelog for more details ([#1272])
80- **added:** Added new `FromRequestParts` trait. See axum's changelog for more
81  details ([#1272])
82- **breaking:** `BodyAlreadyExtracted` has been removed ([#1272])
83
84[#1155]: https://github.com/tokio-rs/axum/pull/1155
85[#1272]: https://github.com/tokio-rs/axum/pull/1272
86
87</details>
88
89# 0.2.8 (10. September, 2022)
90
91- **breaking:** Added default limit to how much data `Bytes::from_request` will
92  consume. Previously it would attempt to consume the entire request body
93  without checking its length. This meant if a malicious peer sent an large (or
94  infinite) request body your server might run out of memory and crash.
95
96  The default limit is at 2 MB and can be disabled by adding the new
97  `DefaultBodyLimit::disable()` middleware. See its documentation for more
98  details.
99
100  This also applies to `String` which used `Bytes::from_request` internally.
101
102  ([#1346])
103
104[#1346]: https://github.com/tokio-rs/axum/pull/1346
105
106# 0.2.7 (10. July, 2022)
107
108- **fix:** Fix typos in `RequestParts` docs ([#1147])
109
110[#1147]: https://github.com/tokio-rs/axum/pull/1147
111
112# 0.2.6 (18. June, 2022)
113
114- **change:** axum-core's MSRV is now 1.56 ([#1098])
115
116[#1098]: https://github.com/tokio-rs/axum/pull/1098
117
118# 0.2.5 (08. June, 2022)
119
120- **added:** Automatically handle `http_body::LengthLimitError` in `FailedToBufferBody` and map
121  such errors to `413 Payload Too Large` ([#1048])
122- **fixed:** Use `impl IntoResponse` less in docs ([#1049])
123
124[#1048]: https://github.com/tokio-rs/axum/pull/1048
125[#1049]: https://github.com/tokio-rs/axum/pull/1049
126
127# 0.2.4 (02. May, 2022)
128
129- **added:** Implement `IntoResponse` and `IntoResponseParts` for `http::Extensions` ([#975])
130- **added:** Implement `IntoResponse` for `(http::response::Parts, impl IntoResponse)` ([#950])
131- **added:** Implement `IntoResponse` for `(http::response::Response<()>, impl IntoResponse)` ([#950])
132- **added:** Implement `IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse)` ([#980])
133
134[#950]: https://github.com/tokio-rs/axum/pull/950
135[#975]: https://github.com/tokio-rs/axum/pull/975
136[#980]: https://github.com/tokio-rs/axum/pull/980
137
138# 0.2.3 (25. April, 2022)
139
140- **added:** Add `response::ErrorResponse` and `response::Result` for
141  `IntoResponse`-based error handling ([#921])
142
143[#921]: https://github.com/tokio-rs/axum/pull/921
144
145# 0.2.2 (19. April, 2022)
146
147- **added:** Add `AppendHeaders` for appending headers to a response rather than overriding them ([#927])
148
149[#927]: https://github.com/tokio-rs/axum/pull/927
150
151# 0.2.1 (03. April, 2022)
152
153- **added:** Add `RequestParts::extract` which allows applying an extractor as a method call ([#897])
154
155[#897]: https://github.com/tokio-rs/axum/pull/897
156
157# 0.2.0 (31. March, 2022)
158
159- **added:** Add `IntoResponseParts` trait which allows defining custom response
160  types for adding headers or extensions to responses ([#797])
161- **breaking:** Using `HeaderMap` as an extractor will no longer remove the headers and thus
162  they'll still be accessible to other extractors, such as `axum::extract::Json`. Instead
163  `HeaderMap` will clone the headers. You should prefer to use `TypedHeader` to extract only the
164  headers you need ([#698])
165
166  This includes these breaking changes:
167    - `RequestParts::take_headers` has been removed.
168    - `RequestParts::headers` returns `&HeaderMap`.
169    - `RequestParts::headers_mut` returns `&mut HeaderMap`.
170    - `HeadersAlreadyExtracted` has been removed.
171    - The `HeadersAlreadyExtracted` variant has been removed from these rejections:
172        - `RequestAlreadyExtracted`
173        - `RequestPartsAlreadyExtracted`
174    - `<HeaderMap as FromRequest<_>>::Rejection` has been changed to `std::convert::Infallible`.
175- **breaking:** `axum::http::Extensions` is no longer an extractor (ie it
176  doesn't implement `FromRequest`). The `axum::extract::Extension` extractor is
177  _not_ impacted by this and works the same. This change makes it harder to
178  accidentally remove all extensions which would result in confusing errors
179  elsewhere ([#699])
180  This includes these breaking changes:
181    - `RequestParts::take_extensions` has been removed.
182    - `RequestParts::extensions` returns `&Extensions`.
183    - `RequestParts::extensions_mut` returns `&mut Extensions`.
184    - `RequestAlreadyExtracted` has been removed.
185    - `<Request as FromRequest>::Rejection` is now `BodyAlreadyExtracted`.
186    - `<http::request::Parts as FromRequest>::Rejection` is now `Infallible`.
187    - `ExtensionsAlreadyExtracted` has been removed.
188- **breaking:** `RequestParts::body_mut` now returns `&mut Option<B>` so the
189  body can be swapped ([#869])
190
191[#698]: https://github.com/tokio-rs/axum/pull/698
192[#699]: https://github.com/tokio-rs/axum/pull/699
193[#797]: https://github.com/tokio-rs/axum/pull/797
194[#869]: https://github.com/tokio-rs/axum/pull/869
195
196# 0.1.2 (22. February, 2022)
197
198- **added:** Implement `IntoResponse` for `bytes::BytesMut` and `bytes::Chain<T, U>` ([#767])
199
200[#767]: https://github.com/tokio-rs/axum/pull/767
201
202# 0.1.1 (06. December, 2021)
203
204- **added:** `axum_core::response::Response` now exists as a shorthand for writing `Response<BoxBody>` ([#590])
205
206[#590]: https://github.com/tokio-rs/axum/pull/590
207
208# 0.1.0 (02. December, 2021)
209
210- Initial release.
211