bool accepts(String type) => _request.headers[HttpHeaders.acceptHeader]! .where((name) => name.split(',').indexOf(type) > 0) .isNotEmpty;