Skip to main content

request_id_middleware

Function request_id_middleware 

Source
pub async fn request_id_middleware(
    request: Request<Body>,
    next: Next,
) -> Response
Expand description

Request ID middleware.

If the request already has an X-Request-Id header, it is preserved. Otherwise, a new UUID v4 is generated and added to both the request extension and the response headers.