'Return a new environ dict targeting the given wsgi.version'

def get_environ(self):

    req = self.req
    env = {'ACTUAL_SERVER_PROTOCOL': req.server.protocol, 'PATH_INFO': req.path, 'QUERY_STRING': req.qs, 'REMOTE_ADDR': (req.conn.remote_addr or ''), 'REMOTE_PORT': str((req.conn.remote_port or '')), 'REQUEST_METHOD': req.method, 'REQUEST_URI': req.uri, 'SCRIPT_NAME': '', 'SERVER_NAME': req.server.server_name, 'SERVER_PROTOCOL': req.request_protocol, 'SERVER_SOFTWARE': req.server.software, 'wsgi.errors': sys.stderr, 'wsgi.input': req.rfile, 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': req.scheme, 'wsgi.version': (1, 0)}
    if isinstance(req.server.bind_addr, basestring):
        env['SERVER_PORT'] = ''
    else:
        env['SERVER_PORT'] = str(req.server.bind_addr[1])
    for (k, v) in req.inheaders.iteritems():
        env[('HTTP_' + k.upper().replace('-', '_'))] = v
    ct = env.pop('HTTP_CONTENT_TYPE', None)
    if (ct is not None):
        env['CONTENT_TYPE'] = ct
    cl = env.pop('HTTP_CONTENT_LENGTH', None)
    if (cl is not None):
        env['CONTENT_LENGTH'] = cl
    if req.conn.ssl_env:
        env.update(req.conn.ssl_env)
    return env
