* Support `Option` and `Result` in typed paths
* changelog
* Update axum-extra/CHANGELOG.md
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
* fix one more
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
* `Path` extractor works with `Deserialize` impls using `&str`
Before this change the extractor `Path<Test>` would fail if the
`Deserialize` implementation of `Test` was calling
`Deserializer::deserialize_str()`.
Now we use `Visitor::visit_borrowed_str()` instead of
`Visitor::visit_str()` which is also recommended in the guide to
implement a deserializer [1].
[1]: https://serde.rs/impl-deserializer.html
* fixup! `Path` extractor works with `Deserialize` impls using `&str`
* add test for percent decoding
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
* move signed cookies into their own module
* Require features for private/signed cookies
* enable "cookie" feature when enabling private/signed cookies
* add `#[cfg]`s in a few more places
* feat: add response::{Error, Result}
This type makes for efficient use of the `?` operator when in a function
with multiple return error types that all implement `IntoResponse`.
Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
* misc adjustments from PR review
* Rename to `ErrorResponse` and `ResultResponse`
* nitpicky docs changes
* update changelog
* changelog wording
* Apply suggestions from code review
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
* axum: Version 0.5.3
* Update axum/CHANGELOG.md
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
* Fix trailing redirection with query parameters
When the request URI matches a route that need a trailing slash, or has an extra trailing slash, the redirect URI is not generated correctly.
This change adds or removes a trailing slash to the path part of the URI, instead of the full URI, preserving query parameters during redirection.
Signed-off-by: David Calavera <david.calavera@gmail.com>
* Make trailing slash logic safer
Extract parts from Uri and recreate it, so it doesn't bump
into corner cases with string manipulation.
Signed-off-by: David Calavera <david.calavera@gmail.com>
* Remove extra assignment.
Signed-off-by: David Calavera <david.calavera@gmail.com>
* Update axum/src/routing/mod.rs
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
* changelog
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
* Remove unnecessary default features for axum from axum-extra
* Update changelog
Co-authored-by: Leon Felix List <uwdxx@student.kit.edu>
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
* Added chunk function to multipart field
This fixes not being able to stream data from a multipart directly into a file or other output.
* doc comment for clarification of usage and &mut self
* fixed formatting
* Corrected example to reflex best practices
* Removed unwrap
* clean up docs
* update changelog
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>