New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update axum and http #1431
Update axum and http #1431
Conversation
Updates to axum 0.7 and http 1.0. Note that this is a breaking change because http is a public dependency of async-await. Some integrations, such as warp, can't be updated yet because they don't support http 1.0.
@davidpdrsn great contribution, thanks! |
S: Send + Sync, | ||
R: IntoResponse + From<ParseRequestError>, | ||
{ | ||
type Rejection = R; | ||
|
||
async fn from_request(req: Request<B>, state: &S) -> Result<Self, Self::Rejection> { | ||
async fn from_request(req: Request, _state: &S) -> Result<Self, Self::Rejection> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not caught by the existing tests, but it fails for me:
102 | if let (&Method::GET, uri) = (req.method(), req.uri()) {
| --- has type `&axum::http::Request<Body>` which is not `Send`
...
128 | .await?,
| ^^^^^ await occurs here, with `req` maybe used later
...
132 | }
| - `req` is later dropped here
help: consider moving this into a `let` binding to create a shorter lived borrow
A solution is to check the method without binding:
if req.method() == Method::GET {
let uri = req.uri();
…
Not sure how this is possible that it does not compile under my usage, while it does when running the test available in this repository 🤔 Perhaps there are no tests for this integration?
Continuing with my comment above, if you initialize the
|
Thanks for noticing! Wasn't aware of the submodule. But before I fix that I'd like to know if updating now is even feasible given that it requires bumping http to 1.0 which is a public dependency of async-graphql. If that breaks the actix-web integration then that's quite unfortunate. |
I'm seeing the same thing as @IvanUkhov. His suggested fix in the I do see the Actix is targeting their http upgrade for v5.0 with this ticket. I couldn't find any Poem or Warp activity around updating It works for Axum though, so in the meantime I'll point to my Github forks. 😁 |
@davidpdrsn use |
waiting on |
@sunli829 |
@sunli829 When do you plan to make a new release? |
released in |
Updates to axum 0.7 and http 1.0.
Note that this is a breaking change because http is a public dependency of async-graphql.
Some integrations, such as warp, can't be updated yet because they don't support http 1.0. Might also get issues with actix-web which appears to use http 0.2 🤔
Fixes #1430