You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Locally swapped out code to work with the rocket 0.5-rc1 and thought why not share it. I understand that this might not be included right now, although I did update the version.
I have made a second attempt to upgrade to rocket 0.5. Some issues that arrived are as follows:
rocket 0.5 went from Sync -> Async code. As such I had to work around serde_urlencoded since rocket::data::DataStream does not implement std::io::Read anymore and instead implements tokio::io::AsyncRead
rocket introduced data limits when opening a raw datastream. I had to modify OAuthRequest::add_body to take an additional optional parameter called 'limits' that passed along the server configured limits. if no limit is specified, then the add_body method will use the hard coded default provided by rocket
I had difficulty with lifetimes in the FromRequest implementation. It is difficult to use borrowed data in FromRequest because you somehow have to specify that the lifetime of the OAuthRequest structure lives at least as long as the request structure but you are returning a new instance of OAuthRequest with borrowed data. I tried a couple of patterns and the only one that seemed to work is where impl<'r> FromRequest<'r> for OAuthRequest<'static>. the examples seem to compile on my machine except for the support module due to the #[path} statement. I still need to work on adding tests and updating docs.
This is my first time contributing to another project. please let me know if there is anything that needs to be done here and I will submit another pull request
Project Improvement
Locally swapped out code to work with the rocket 0.5-rc1 and thought why not share it. I understand that this might not be included right now, although I did update the version.
Tracking pull request
The text was updated successfully, but these errors were encountered: