

def send_streamheader(self, handle, connection):
    ' Send response header for text/event-stream\n        '
    response = ((('HTTP/1.0 200 OK\n' + 'Content-Type: text/event-stream\n') + 'Access-Control-Allow-Origin: *\r\n') + '\n')
    if (connection is not None):
        if (not connection.connection_lost):
            connection.send(response)
    elif (self.tunnel_client is not None):
        msg = {
            'cmd': 'logresp',
            'msgid': handle,
            'header': response,
            'data': None,
        }
        self.tunnel_client.send(msg)

dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/calvincontrol.py CalvinControl.send_streamheader/original