'Process Accept header or simply return correct API controller.
If there is a version identifier in the URI,
return the correct API controller, otherwise, if we
find an Accept: header, process it'

def process_request(self, req):

    msg = ('Processing    request:    %(method)s    %(path)s    Accept:    %(accept)s' % {'method': req.method, 'path': req.path, 'accept': req.accept})
    LOG.debug(msg)
    if (req.path_info_peek() in ('versions', '')):
        return self.versions_app
    match = self._match_version_string(req.path_info_peek(), req)
    if match:
        major_version = req.environ['api.major_version']
        minor_version = req.environ['api.minor_version']
        if ((major_version == 1) and (minor_version == 0)):
            LOG.debug(('Matched    versioned    URI.    Version:    %(major_version)d.%(minor_version)d' % {'major_version': major_version, 'minor_version': minor_version}))
            req.path_info_pop()
            return None
        else:
            LOG.debug(('Unknown    version    in    versioned    URI:    %(major_version)d.%(minor_version)d.    Returning    version    choices.' % {'major_version': major_version, 'minor_version': minor_version}))
            return self.versions_app
    accept = str(req.accept)
    if accept.startswith('application/vnd.openstack.orchestration-'):
        token_loc = len('application/vnd.openstack.orchestration-')
        accept_version = accept[token_loc:]
        match = self._match_version_string(accept_version, req)
        if match:
            major_version = req.environ['api.major_version']
            minor_version = req.environ['api.minor_version']
            if ((major_version == 1) and (minor_version == 0)):
                LOG.debug(('Matched    versioned    media    type.    Version:    %(major_version)d.%(minor_version)d' % {'major_version': major_version, 'minor_version': minor_version}))
                return None
            else:
                LOG.debug(('Unknown    version    in    accept    header:    %(major_version)d.%(minor_version)d...    returning    version    choices.' % {'major_version': major_version, 'minor_version': minor_version}))
                return self.versions_app
    else:
        if (req.accept not in ('*/*', '')):
            LOG.debug('Unknown    accept    header:    %s...    returning    HTTP    not    found.', req.accept)
        return webob.exc.HTTPNotFound()
    return None
