

def __call__(self, env, start_response):
    '\n        Main hook into the WSGI paste.deploy filter/app pipeline.\n\n        :param env: The WSGI environment dict.\n        :param start_response: The WSGI start_response hook.\n        '
    env['staticweb.start_time'] = time.time()
    if ('swift.authorize' not in env):
        self.logger.warning('No authentication middleware authorized request yet. Skipping staticweb')
        return self.app(env, start_response)
    try:
        (version, account, container, obj) = split_path(env['PATH_INFO'], 2, 4, True)
    except ValueError:
        return self.app(env, start_response)
    if (env['REQUEST_METHOD'] not in ('HEAD', 'GET')):
        return self.app(env, start_response)
    if (env.get('REMOTE_USER') and (not config_true_value(env.get('HTTP_X_WEB_MODE', 'f')))):
        return self.app(env, start_response)
    if (not container):
        return self.app(env, start_response)
    context = _StaticWebContext(self, version, account, container, obj)
    if obj:
        return context.handle_object(env, start_response)
    return context.handle_container(env, start_response)

dataset/ETHPy150Open openstack/swift/swift/common/middleware/staticweb.py StaticWeb.__call__/original