Skip to content
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

Remove constraint that request body is hyper::Body #33

Open
mitchhentges opened this issue Dec 27, 2020 · 1 comment
Open

Remove constraint that request body is hyper::Body #33

mitchhentges opened this issue Dec 27, 2020 · 1 comment

Comments

@mitchhentges
Copy link

Thanks for Routerify! It's very useful for my hyper projects :)

I'm writing an application that acts as a small web container, and the service I'm using has an API that only uses the http crate's abstractions (rather than being specific to hyper).
However, this means that I can't use routerify, because it expects requests to be Request<hyper::Body> (as opposed to Request<&[u8]>, which the service provides).

Would it be possible to relax the constraint so that routes do Request<B> -> Response<B> instead?

@rousan
Copy link
Member

rousan commented Feb 17, 2021

Hey @mitchhentges, At the beginning I restricted to use hyper::Body as the base body type for simple design, but as the hyper crate accepts any body type as long as it implements HttpBody trait, so we can also restrict this trait constraint to routerify. We can have a plan to extend this in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants