def get_headers_from_environ(environ):
 headers = wsgiref.headers.Headers([])
 for (header, value) in environ.iteritems():
  if header.startswith('HTTP_'):
   headers[header[5:].replace('_', '-')] = value
 if ('CONTENT_TYPE' in environ):
  headers['CONTENT-TYPE'] = environ['CONTENT_TYPE']
 return headers

def get_headers_from_environ ( environ ) : headers = wsgiref . headers . Headers ( [ ] ) for ( header , value ) in environ . iteritems ( ) : if header . startswith ( 'HTTP_' ) : headers [ header [ 5 : ] . replace ( '_' , '-' ) ] = value if ( 'CONTENT_TYPE' in environ ) : headers [ 'CONTENT-TYPE' ] = environ [ 'CONTENT_TYPE' ] return headers
get a wsgiref .