Request environment middleware for connect