def render_GET(self, request):
        if "text/event-stream" not in (request.getHeader("accept") or ""):
            request.setResponseCode(http.BAD_REQUEST, "Must use EventSource")
            return "Must use EventSource (Content-Type: text/event-stream)"
        request.setHeader("content-type", "text/event-stream")
        self.events_protocol = EventsProtocol(request)
        request.notifyFinish().addErrback(self._shutdown)
        # tell the frontend it's safe to subscribe
        self.events_protocol.sendEvent(json.dumps({"type": "ready"}))
        return server.NOT_DONE_YET
dataset/ETHPy150Open warner/petmail/petmail/web.py/EventChannel.render_GET/original