feat(awc): allow to retrieve request head in client response#3535
Open
joelwurtz wants to merge 1 commit intoactix:mainfrom
Open
feat(awc): allow to retrieve request head in client response#3535joelwurtz wants to merge 1 commit intoactix:mainfrom
joelwurtz wants to merge 1 commit intoactix:mainfrom
Conversation
|
I'm getting this error when compiling awc from this branch (as a dependency in another project): error[E0277]: the trait bound `actix_http::h1::Message<(RequestHeadType, BodySize)>: From<(&mut RequestHeadType, BodySize)>` is not satisfied
--> /home/rharish/.cargo/git/checkouts/actix-web-aacbeff6ed990534/adf3a06/awc/src/client/h1proto.rs:89:50
|
89 | pin_framed.send((&mut head, body.size()).into()).await?;
| ^^^^ the trait `From<(&mut RequestHeadType, BodySize)>` is not implemented for `actix_http::h1::Message<(RequestHeadType, BodySize)>`, which is required by `(&mut RequestHeadType, BodySize): Into<_>`
|
= help: the trait `From<(RequestHeadType, BodySize)>` is implemented for `actix_http::h1::Message<(RequestHeadType, BodySize)>`
= help: for that trait implementation, expected `RequestHeadType`, found `&mut RequestHeadType`
= note: required for `(&mut RequestHeadType, BodySize)` to implement `Into<actix_http::h1::Message<(RequestHeadType, BodySize)>>`
error[E0277]: the trait bound `actix_http::h1::Message<(RequestHeadType, BodySize)>: From<(&mut RequestHeadType, BodySize)>` is not satisfied
--> /home/rharish/.cargo/git/checkouts/actix-web-aacbeff6ed990534/adf3a06/awc/src/client/h1proto.rs:99:50
|
99 | pin_framed.feed((&mut head, body.size()).into()).await?;
| ^^^^ the trait `From<(&mut RequestHeadType, BodySize)>` is not implemented for `actix_http::h1::Message<(RequestHeadType, BodySize)>`, which is required by `(&mut RequestHeadType, BodySize): Into<_>`
|
= help: the trait `From<(RequestHeadType, BodySize)>` is implemented for `actix_http::h1::Message<(RequestHeadType, BodySize)>`
= help: for that trait implementation, expected `RequestHeadType`, found `&mut RequestHeadType`
= note: required for `(&mut RequestHeadType, BodySize)` to implement `Into<actix_http::h1::Message<(RequestHeadType, BodySize)>>`
error[E0277]: the trait bound `actix_http::h1::Message<(RequestHeadType, BodySize)>: From<(&mut RequestHeadType, BodySize)>` is not satisfied
--> /home/rharish/.cargo/git/checkouts/actix-web-aacbeff6ed990534/adf3a06/awc/src/client/h1proto.rs:147:45
|
147 | framed.send((&mut head, BodySize::None).into()).await?;
| ^^^^ the trait `From<(&mut RequestHeadType, BodySize)>` is not implemented for `actix_http::h1::Message<(RequestHeadType, BodySize)>`, which is required by `(&mut RequestHeadType, BodySize): Into<_>`
|
= help: the trait `From<(RequestHeadType, BodySize)>` is implemented for `actix_http::h1::Message<(RequestHeadType, BodySize)>`
= help: for that trait implementation, expected `RequestHeadType`, found `&mut RequestHeadType`
= note: required for `(&mut RequestHeadType, BodySize)` to implement `Into<actix_http::h1::Message<(RequestHeadType, BodySize)>>`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `awc` (lib) due to 3 previous errors |
Contributor
Author
|
This is because there was a change in actix-http in order for this to work, you have to use this branch for actix http also |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Feat
PR Checklist
Overview
This pr will allow to add the request head used to send the request to server into the response, this allow by example retrieving the final url in case of a redirect
(This can also be used by other middleware to log a request / response pair also)
Fix #3403