Skip to content

Commit b564097

Browse files
authored
Merge pull request #12257 from rust-lang/renovate/axum-monorepo
Update Rust crate axum-extra to v0.12.1
2 parents b214731 + 9b6c649 commit b564097

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ aws-credential-types = { version = "=1.2.8", features = ["hardcoded-credentials"
6060
aws-sdk-cloudfront = "=1.100.0"
6161
aws-sdk-sqs = "=1.88.0"
6262
axum = { version = "=0.8.6", features = ["macros", "matched-path"] }
63-
axum-extra = { version = "=0.10.3", features = ["erased-json", "query", "typed-header"] }
63+
axum-extra = { version = "=0.12.1", features = ["erased-json", "middleware", "query", "typed-header"] }
6464
base64 = "=0.22.1"
6565
bigdecimal = { version = "=0.4.9", features = ["serde"] }
6666
bon = "=3.8.1"

crates/crates_io_session/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ workspace = true
99

1010
[dependencies]
1111
axum = { version = "=0.8.6", features = ["macros"] }
12-
axum-extra = { version = "=0.10.3", features = ["cookie-signed"] }
12+
axum-extra = { version = "=0.12.1", features = ["cookie-signed"] }
1313
base64 = "=0.22.1"
1414
cookie = { version = "=0.18.1", features = ["secure"] }
1515
parking_lot = "=0.12.5"

src/middleware.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod update_metrics;
1313

1414
use ::sentry::integrations::tower as sentry_tower;
1515
use axum::Router;
16-
use axum::middleware::{from_fn, from_fn_with_state};
16+
use axum::middleware::{ResponseAxumBodyLayer, from_fn, from_fn_with_state};
1717
use axum_extra::either::Either;
1818
use axum_extra::middleware::option_layer;
1919
use std::time::Duration;
@@ -90,6 +90,9 @@ pub fn apply_axum_middleware(state: AppState, router: Router<()>) -> Router {
9090
.layer(CompressionLayer::new().quality(CompressionLevel::Fastest))
9191
}
9292

93-
pub fn conditional_layer<L, F: FnOnce() -> L>(condition: bool, layer: F) -> Either<L, Identity> {
93+
pub fn conditional_layer<L, F: FnOnce() -> L>(
94+
condition: bool,
95+
layer: F,
96+
) -> Either<(ResponseAxumBodyLayer, L), Identity> {
9497
option_layer(condition.then(layer))
9598
}

0 commit comments

Comments
 (0)