private static async Task CookieMiddleware(HttpContext context, Func <Task> next) { if (context.Request.IsInteresting()) { CookieHandler.Handle(context); HeaderHandler.Handle(context); } await next(); }