summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/eventsource/resources/message2.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/eventsource/resources/message2.py')
-rw-r--r--testing/web-platform/tests/eventsource/resources/message2.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/eventsource/resources/message2.py b/testing/web-platform/tests/eventsource/resources/message2.py
new file mode 100644
index 000000000..ce339d927
--- /dev/null
+++ b/testing/web-platform/tests/eventsource/resources/message2.py
@@ -0,0 +1,35 @@
+import time
+
+def main(request, response):
+ response.headers.set('Content-Type', 'text/event-stream')
+ response.headers.set('Cache-Control', 'no-cache')
+
+ response.explicit_flush = True
+ response.write_status_headers()
+
+ while True:
+ response.writer.write("data:msg")
+ response.writer.write("\n")
+ response.writer.write("data: msg")
+ response.writer.write("\n\n")
+
+ response.writer.write(":")
+ response.writer.write("\n")
+
+ response.writer.write("falsefield:msg")
+ response.writer.write("\n\n")
+
+ response.writer.write("falsefield:msg")
+ response.writer.write("\n")
+
+ response.writer.write("Data:data")
+ response.writer.write("\n\n")
+
+ response.writer.write("data")
+ response.writer.write("\n\n")
+
+ response.writer.write("data:end")
+ response.writer.write("\n\n")
+
+ response.writer.flush()
+ time.sleep(2)