This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Unable to find Tower middleware signature constraints that works with both Axum and Hyper #3508
Labels
C-bug
Category: bug. Something is wrong. This is bad!
Version
hyper 1, http 1
Platform
Linux thinkpad-z13 6.6.6-1-default #1 SMP PREEMPT_DYNAMIC Mon Dec 11 09:46:39 UTC 2023 (a946a9f) x86_64 x86_64 x86_64 GNU/Linux
Description
Attempting to update a tower middleware to work with axum 0.7 and hyper 1.0
Previously works with axum 0.6 and hyper 0.14
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:
https://github.com/francoposa/tower-otel-http-metrics/pull/4/files
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:
https://github.com/francoposa/tower-otel-http-metrics/blob/axum-0.7-compatibility/examples/axum-http-service/src/main.rs
Hyper 1.0 server code that won't work with the updated middleware or the old middleware:
https://github.com/francoposa/tower-otel-http-metrics/blob/axum-0.7-compatibility/examples/tower-http-service/src/main.rs
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.
I thus far have not found any middleware code examples anywhere that work with both axum 0.7 and hyper 1.0.
The text was updated successfully, but these errors were encountered: