I am using actix-web 3. I would like to access the current status code from within Actix-web’s middleware system.
I would like to modify the request based on the StatusCode
, is this possible?
For instance if the user sends some data that causes actix-web to generate the 413 code, I would like to modify the Request.
I can modify the Response
by the use of a handler of ErrorHandlers
but these handlers only have mut res: ServiceResponse<B>
as their arguments and it seems I am unable to find a way to access ServiceRequest
object from within these handlers.
I would like to result to using basic middleware as the ServiceRequest
and ServiceResponse
objects are available in the middleware.