mirror of
https://github.com/servo/servo.git
synced 2025-07-13 10:23:40 +01:00
9 lines
340 B
Python
9 lines
340 B
Python
def main(request, response):
|
|
response.headers.set("Content-Type", "text/event-stream")
|
|
|
|
last_event_id = request.headers.get("Last-Event-ID", None)
|
|
if last_event_id:
|
|
return "data: " + last_event_id + "\n\n"
|
|
else:
|
|
idvalue = request.GET.first("idvalue", u"\u2026")
|
|
return "id: " + idvalue + "\nretry: 200\ndata: hello\n\n"
|