Middleware for capturing HAR-traces of requests