Unexpected CookieJar extractor compile error in middleware when upgrading from axum-extra version 0.9.6 to 0.10.0 #3135
-
SummaryI am using: I have this middleware function: pub async fn cookie_middleware(
jar: axum_extra::extract::CookieJar,
mut req: axum::extract::Request,
next: axum::middleware::Next,
) -> axum::response::Response {
// some code, makes no difference
// Pass the request to the next handler
next.run(req).await
} I use it in this way: let app = Router::new()
.route(
"/",
get(|| async { Redirect::permanent("/app/index.html") }),
)
.with_state(app_state)
.layer(Extension(session_store))
.layer(CompressionLayer::new())
.layer(axum::middleware::from_fn(middleware::cookie_middleware))
; And when I upgrade to axum-extra 0.10.0, I get this error that I did not have in version 0.9.6:
The issue seems to be that I can no longer use the CookieJar extractor as part of the function signature. Can I no longer do that? axum version0.7.9 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
axum-extra 0.10 and axum 0.7 use different versions of axum-core. You have to upgrade axum and axum-extra at the same time. |
Beta Was this translation helpful? Give feedback.
-
@jplatte - Thanks for the quick reply. |
Beta Was this translation helpful? Give feedback.
axum-extra 0.10 and axum 0.7 use different versions of axum-core. You have to upgrade axum and axum-extra at the same time.