actix-request-hook 1.0.0-beta.4

Actix web middleware hook for requests. Enables subscribing to request start and end, request id, elapsed time between requests and more.
Documentation
1
2
3
4
5
6
7
8
9
use actix_http::Payload;
use actix_web::web::Bytes;

/// Converts bytes to payload stream
pub fn get_payload(bytes: Bytes) -> Payload {
    let mut repack_payload = actix_http::h1::Payload::create(true);
    repack_payload.1.unread_data(bytes);
    repack_payload.1.into()
}