Replies: 1 comment
-
Did you find solution? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm building a simple API server and I want as many of its responses to be JSON-formatted, including errors. I wanted to put a request timeout on this server and a max request body limit. I quickly found out that
tower_http
's TimeoutLayer could not be customized because it automatically converts errors to a response with a text/plain body. Howevertower
's TimeoutLayer can be customized with aHandleErrorLayer
so I did just that. Unfortunately, I have not been able to find anything likeRequestBodyLimitLayer
intower
. Seemingly onlytower_http
has this layer which does not allow customization.How can I solve this without creating my own service layer?
Beta Was this translation helpful? Give feedback.
All reactions