def SendCGIResponse(status, headers, content, outfile, cors_handler=None):
 if cors_handler:
  cors_handler.UpdateHeaders(headers)
 outfile.write(('Status: %s\r\n' % status))
 WriteHeaders(headers, outfile, (len(content) if content else None))
 outfile.write('\r\n')
 if content:
  outfile.write(content)
 outfile.seek(0)

def SendCGIResponse ( status , headers , content , outfile , cors_handler = None ) : if cors_handler : cors_handler . UpdateHeaders ( headers ) outfile . write ( ( 'Status: %s\r\n' % status ) ) WriteHeaders ( headers , outfile , ( len ( content ) if content else None ) ) outfile . write ( '\r\n' ) if content : outfile . write ( content ) outfile . seek ( 0 )
dump reformatted response to cgi outfile .