

def __call__(self, environ, start_response):
    cleaned_path = environ.get('PATH_INFO', '').strip('/')
    for sep in (os.sep, os.altsep):
        if (sep and (sep != '/')):
            cleaned_path = cleaned_path.replace(sep, '/')
    path = '/'.join(([''] + [x for x in cleaned_path.split('/') if (x and (x != '..'))]))
    (real_filename, file_loader) = self.loader(path[1:])
    if (file_loader is None):
        return self.app(environ, start_response)
    guessed_type = mimetypes.guess_type(real_filename)
    mime_type = (guessed_type[0] or self.fallback_mimetype)
    (f, mtime, file_size) = file_loader()
    headers = [('Date', http_date())]
    headers.append(('Cache-Control', 'public'))
    environ.extend((('Content-Type', mime_type), ('Content-Length', str(file_size)), ('Last-Modified', http_date(mtime))))
    start_response('200 OK', headers)
    return wrap_file(environ, f)

dataset/ETHPy150Open pecan/pecan/pecan/middleware/static.py StaticFileMiddleware.__call__/VarMisuse@201/254 `headers`->`environ`