Unable to find Tower middleware signature constraints that works with both Axum and Hyper #3513
-
Version Platform Description I had to unconstrain the Body parameter for Service to be accepted by axum, but now hyper 0.14 and hyper 1.0 won't accept it: I based the generics signatures off of the tower-http request-id middleware in order to get it working with axum 0.7 again. Axum 0.7 server code that now works with the updated middleware: Hyper 1.0 server code that won't work with the updated middleware or the old middleware: I also tried the hyper 1.0 server guide, and get the same issue - in fact the tower http request ID middleware also has the same issue.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There's a couple changes that happened:
So, if you're trying to upgrade your middleware, you'll want to use |
Beta Was this translation helpful? Give feedback.
There's a couple changes that happened:
tower::Service
andhttp_body_04::Body
traits.Service
andhttp_body_1::Body
traits.So, if you're trying to upgrade your middleware, you'll want to use
tower::Service
andhttp_body
v1, and then you can use it with hyper v1 thanks to this hyper-util adapter.