Releases: imbolc/tower-cookies
Releases · imbolc/tower-cookies
Update to axum-core 0.1
This changes tower-cookies
to have a public dependency on axum-core
instead of axum
.
axum-core
is designed to be a small crate that only contains the
FromRequest
and IntoResponse
traits. Because of the smaller API its
less likely to receive breaking changes. Therefore its recommended for
library to depend on that instead of axum
.
Note this is a breaking change since axum
0.3 doesn't know about
axum-core
.
Thank you @davidpdrsn 🙏
Signed cookies
async fn handler(cookies: Cookies) -> String {
cookies.signed(&my_key).get("my_cookie").unwrap().value.into()
}
Optimization
Fix: changed
flag was unnecessary enabled on Cookies::get
Examples and docs are adapted to Axum-0.3
v0.2.1 Examples and docs is adapted to Axum-0.3
No need for `Cookies` to be `mut` anymore
Cookies
methods now take&self
instead of&mut self
.
Migration:fn handler(mut cookies: Cookies)
=>fn handler(cookies: Cookies)
- Standard layer semantic.
Migration:.layer(CookieLayer)
=>.layer(CookieManagerLayer::new())
Thank you @programatik29 🙏