How can I determine whether or not ResponseBodyTimeoutLayer timed out? #536
-
SummaryI'm building an application using axum and I was hoping to use Router::new()
...
.layer(ResponseBodyTimeoutLayer::new(Duration::from_nanos(1))) which does timeout the body, but my response status code is unchanged. I'm trying to figure out how to handle the body timeout (change status, etc), but I'm not having any luck. tower-http version0.6.1 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This may not be all that helpful, but note that the status code is already sent by the time the body timeout happens. That's why it's unchanged. |
Beta Was this translation helpful? Give feedback.
-
It would be impossible to modify the status if the body times out since the status gets sent first |
Beta Was this translation helpful? Give feedback.
This may not be all that helpful, but note that the status code is already sent by the time the body timeout happens. That's why it's unchanged.