Update Axum integration to Axum 0.5
This commit is contained in:
parent
9318c0731d
commit
824153d740
|
@ -15,7 +15,7 @@ categories = ["network-programming", "asynchronous"]
|
||||||
async-graphql = { path = "../..", version = "3.0.37" }
|
async-graphql = { path = "../..", version = "3.0.37" }
|
||||||
|
|
||||||
async-trait = "0.1.51"
|
async-trait = "0.1.51"
|
||||||
axum = { version = "0.4", features = ["ws", "headers"] }
|
axum = { version = "0.5", features = ["ws", "headers"] }
|
||||||
bytes = "1.0.1"
|
bytes = "1.0.1"
|
||||||
http-body = "0.4.2"
|
http-body = "0.4.2"
|
||||||
serde_json = "1.0.66"
|
serde_json = "1.0.66"
|
||||||
|
|
|
@ -106,7 +106,7 @@ where
|
||||||
} else {
|
} else {
|
||||||
let content_type = req
|
let content_type = req
|
||||||
.headers()
|
.headers()
|
||||||
.and_then(|headers| headers.get(http::header::CONTENT_TYPE))
|
.get(http::header::CONTENT_TYPE)
|
||||||
.and_then(|value| value.to_str().ok())
|
.and_then(|value| value.to_str().ok())
|
||||||
.map(ToString::to_string);
|
.map(ToString::to_string);
|
||||||
let body_stream = BodyStream::from_request(req)
|
let body_stream = BodyStream::from_request(req)
|
||||||
|
|
|
@ -29,7 +29,7 @@ impl<B: Send> FromRequest<B> for GraphQLProtocol {
|
||||||
|
|
||||||
async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
|
async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
|
||||||
req.headers()
|
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(|value| value.to_str().ok())
|
||||||
.and_then(|protocols| {
|
.and_then(|protocols| {
|
||||||
protocols
|
protocols
|
||||||
|
|
Loading…
Reference in New Issue
Block a user