'This servers rekall profiles from the frontend server.
Format is /rekall_profiles/<version>/<profile_name>
Args:
path: The path the client requested.'

def ServeRekallProfile(self, path):

    logging.debug('Rekall    profile    request    from    IP    %s    for    %s', self.client_address[0], path)
    remaining_path = path[len(self.rekall_profile_path):]
    if (not remaining_path.startswith('/')):
        self.Send('Error    serving    profile.', status=500, ctype='text/plain')
        return
    components = remaining_path[1:].split('/', 1)
    if (len(components) != 2):
        self.Send('Error    serving    profile.', status=500, ctype='text/plain')
        return
    (version, name) = components
    profile = self.server.frontend.GetRekallProfile(name, version=version)
    if (not profile):
        self.Send('Profile    not    found.', status=404, ctype='text/plain')
        return
    json_data = json_format.MessageToJson(profile.AsPrimitiveProto())
    sanitized_data = (")]}'\n" + json_data.replace('<', '\\u003c').replace('>', '\\u003e'))
    additional_headers = {'Content-Disposition': 'attachment;    filename=response.json', 'X-Content-Type-Options': 'nosniff'}
    self.Send(sanitized_data, status=200, ctype='application/json', additional_headers=additional_headers)
