axum/axum-core/CHANGELOG.md

147 lines
5.6 KiB
Markdown
Raw Normal View History

# 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
- **added:** Add `DefaultBodyLimit::max` for changing the default body limit ([#1397])
[#1397]: https://github.com/tokio-rs/axum/pull/1397
# 0.3.0-rc.2 (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
# 0.3.0-rc.1 (23. August, 2022)
Only allow last extractor to mutate the request (#1272) * Only allow last extractor to mutate the request * Change `FromRequest` and add `FromRequestParts` trait (#1275) * Add `Once`/`Mut` type parameter for `FromRequest` and `RequestParts` * 🪄 * split traits * `FromRequest` for tuples * Remove `BodyAlreadyExtracted` * don't need fully qualified path * don't export `Once` and `Mut` * remove temp tests * depend on axum again Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * Port `Handler` and most extractors (#1277) * Port `Handler` and most extractors * Put `M` inside `Handler` impls, not trait itself * comment out tuples for now * fix lints * Reorder arguments to `Handler` (#1281) I think `Request<B>, Arc<S>` is better since its consistent with `FromRequest` and `FromRequestParts`. * Port most things in axum-extra (#1282) * Port `#[derive(TypedPath)]` and `#[debug_handler]` (#1283) * port #[derive(TypedPath)] * wip: #[debug_handler] * fix #[debug_handler] * don't need itertools * also require `Send` * update expected error * support fully qualified `self` * Implement FromRequest[Parts] for tuples (#1286) * Port docs for axum and axum-core (#1285) * Port axum-extra (#1287) * Port axum-extra * Update axum-core/Cargo.toml Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * remove `impl FromRequest for Either*` Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * New FromRequest[Parts] trait cleanup (#1288) * Make private module truly private again * Simplify tuple FromRequest implementation * Port `#[derive(FromRequest)]` (#1289) * fix tests * fix docs * revert examples * fix docs link * fix intra docs links * Port examples (#1291) * Document wrapping other extractors (#1292) * axum-extra doesn't need to depend on axum-core (#1294) Missed this in https://github.com/tokio-rs/axum/pull/1287 * Add `FromRequest` changes to changelogs (#1293) * Update changelog * Remove default type for `S` in `Handler` * Clarify which types have default types for `S` * Apply suggestions from code review Co-authored-by: Jonas Platte <jplatte+git@posteo.de> Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * remove unused import * Rename `Mut` and `Once` (#1296) * fix trybuild expected output Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
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])
Add type safe state extractor (#1155) * begin threading the state through * Pass state to extractors * make state extractor work * make sure nesting with different states work * impl Service for MethodRouter<()> * Fix some of axum-macro's tests * Implement more traits for `State` * Update examples to use `State` * consistent naming of request body param * swap type params * Default the state param to () * fix docs references * Docs and handler state refactoring * docs clean ups * more consistent naming * when does MethodRouter implement Service? * add missing docs * use `Router`'s default state type param * changelog * don't use default type param for FromRequest and RequestParts probably safer for library authors so you don't accidentally forget * fix examples * minor docs tweaks * clarify how to convert handlers into services * group methods in one impl block * make sure merged `MethodRouter`s can access state * fix docs link * test merge with same state type * Document how to access state from middleware * Port cookie extractors to use state to extract keys (#1250) * Updates ECOSYSTEM with a new sample project (#1252) * Avoid unhelpful compiler suggestion (#1251) * fix docs typo * document how library authors should access state * Add `RequestParts::with_state` * fix example * apply suggestions from review * add relevant changes to axum-extra and axum-core changelogs * Add `route_service_with_tsr` * fix trybuild expectations * make sure `SpaRouter` works with routers that have state * Change order of type params on FromRequest and RequestParts * reverse order of `RequestParts::with_state` args to match type params * Add `FromRef` trait (#1268) * Add `FromRef` trait * Remove unnecessary type params * format * fix docs link * format examples * Avoid unnecessary `MethodRouter` * apply suggestions from review Co-authored-by: Dani Pardo <dani.pardo@inmensys.com> Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-08-17 17:13:31 +02:00
[#1155]: https://github.com/tokio-rs/axum/pull/1155
Only allow last extractor to mutate the request (#1272) * Only allow last extractor to mutate the request * Change `FromRequest` and add `FromRequestParts` trait (#1275) * Add `Once`/`Mut` type parameter for `FromRequest` and `RequestParts` * 🪄 * split traits * `FromRequest` for tuples * Remove `BodyAlreadyExtracted` * don't need fully qualified path * don't export `Once` and `Mut` * remove temp tests * depend on axum again Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * Port `Handler` and most extractors (#1277) * Port `Handler` and most extractors * Put `M` inside `Handler` impls, not trait itself * comment out tuples for now * fix lints * Reorder arguments to `Handler` (#1281) I think `Request<B>, Arc<S>` is better since its consistent with `FromRequest` and `FromRequestParts`. * Port most things in axum-extra (#1282) * Port `#[derive(TypedPath)]` and `#[debug_handler]` (#1283) * port #[derive(TypedPath)] * wip: #[debug_handler] * fix #[debug_handler] * don't need itertools * also require `Send` * update expected error * support fully qualified `self` * Implement FromRequest[Parts] for tuples (#1286) * Port docs for axum and axum-core (#1285) * Port axum-extra (#1287) * Port axum-extra * Update axum-core/Cargo.toml Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * remove `impl FromRequest for Either*` Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * New FromRequest[Parts] trait cleanup (#1288) * Make private module truly private again * Simplify tuple FromRequest implementation * Port `#[derive(FromRequest)]` (#1289) * fix tests * fix docs * revert examples * fix docs link * fix intra docs links * Port examples (#1291) * Document wrapping other extractors (#1292) * axum-extra doesn't need to depend on axum-core (#1294) Missed this in https://github.com/tokio-rs/axum/pull/1287 * Add `FromRequest` changes to changelogs (#1293) * Update changelog * Remove default type for `S` in `Handler` * Clarify which types have default types for `S` * Apply suggestions from code review Co-authored-by: Jonas Platte <jplatte+git@posteo.de> Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * remove unused import * Rename `Mut` and `Once` (#1296) * fix trybuild expected output Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
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
# 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])
[#1098]: https://github.com/tokio-rs/axum/pull/1098
2022-06-08 15:56:56 +02:00
# 0.2.5 (08. June, 2022)
- **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])
[#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)
- **added:** Implement `IntoResponse` and `IntoResponseParts` for `http::Extensions` ([#975])
- **added:** Implement `IntoResponse` for `(http::response::Parts, impl IntoResponse)` ([#950])
- **added:** Implement `IntoResponse` for `(http::response::Response<()>, impl IntoResponse)` ([#950])
- **added:** Implement `IntoResponse for (Parts | Request<()>, $(impl IntoResponseParts)+, impl IntoResponse)` ([#980])
[#950]: https://github.com/tokio-rs/axum/pull/950
[#975]: https://github.com/tokio-rs/axum/pull/975
[#980]: https://github.com/tokio-rs/axum/pull/980
2022-04-26 16:19:47 +02:00
# 0.2.3 (25. April, 2022)
- **added:** Add `response::ErrorResponse` and `response::Result` for
`IntoResponse`-based error handling ([#921])
[#921]: https://github.com/tokio-rs/axum/pull/921
2022-04-19 16:17:52 +02:00
# 0.2.2 (19. April, 2022)
- **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)
- **added:** Add `IntoResponseParts` trait which allows defining custom response
types for adding headers or extensions to responses ([#797])
- **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`.
- **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`.
- `ExtensionsAlreadyExtracted` has been removed.
- **breaking:** `RequestParts::body_mut` now returns `&mut Option<B>` so the
body can be swapped ([#869])
[#698]: https://github.com/tokio-rs/axum/pull/698
[#699]: https://github.com/tokio-rs/axum/pull/699
[#797]: https://github.com/tokio-rs/axum/pull/797
[#869]: https://github.com/tokio-rs/axum/pull/869
# 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
# 0.1.1 (06. December, 2021)
- **added:** `axum_core::response::Response` now exists as a shorthand for writing `Response<BoxBody>` ([#590])
[#590]: https://github.com/tokio-rs/axum/pull/590
# 0.1.0 (02. December, 2021)
- Initial release.