From 824153d740e87f992422a5d7cfd4126ba2996c36 Mon Sep 17 00:00:00 2001 From: Calin Gavriliuc <13826789+alisenai@users.noreply.github.com> Date: Sun, 3 Apr 2022 22:02:55 -0700 Subject: [PATCH] Update Axum integration to Axum 0.5 --- integrations/axum/Cargo.toml | 2 +- integrations/axum/src/extract.rs | 2 +- integrations/axum/src/subscription.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integrations/axum/Cargo.toml b/integrations/axum/Cargo.toml index 292634cf..0277c77d 100644 --- a/integrations/axum/Cargo.toml +++ b/integrations/axum/Cargo.toml @@ -15,7 +15,7 @@ categories = ["network-programming", "asynchronous"] async-graphql = { path = "../..", version = "3.0.37" } async-trait = "0.1.51" -axum = { version = "0.4", features = ["ws", "headers"] } +axum = { version = "0.5", features = ["ws", "headers"] } bytes = "1.0.1" http-body = "0.4.2" serde_json = "1.0.66" diff --git a/integrations/axum/src/extract.rs b/integrations/axum/src/extract.rs index 264d48d8..df298cfa 100644 --- a/integrations/axum/src/extract.rs +++ b/integrations/axum/src/extract.rs @@ -106,7 +106,7 @@ where } else { let content_type = req .headers() - .and_then(|headers| headers.get(http::header::CONTENT_TYPE)) + .get(http::header::CONTENT_TYPE) .and_then(|value| value.to_str().ok()) .map(ToString::to_string); let body_stream = BodyStream::from_request(req) diff --git a/integrations/axum/src/subscription.rs b/integrations/axum/src/subscription.rs index 11c3fe4b..9333bb7e 100644 --- a/integrations/axum/src/subscription.rs +++ b/integrations/axum/src/subscription.rs @@ -29,7 +29,7 @@ impl FromRequest for GraphQLProtocol { async fn from_request(req: &mut RequestParts) -> Result { req.headers() - .and_then(|headers| headers.get(http::header::SEC_WEBSOCKET_PROTOCOL)) + .get(http::header::SEC_WEBSOCKET_PROTOCOL) .and_then(|value| value.to_str().ok()) .and_then(|protocols| { protocols