Update Axum integration to Axum 0.5

This commit is contained in:
Calin Gavriliuc 2022-04-03 22:02:55 -07:00
parent aa15be435a
commit aee663294d
3 changed files with 3 additions and 3 deletions

View File

@ -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"

View File

@ -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)

View File

@ -29,7 +29,7 @@ impl<B: Send> FromRequest<B> for GraphQLProtocol {
async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
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