diff options
Diffstat (limited to '')
-rw-r--r-- | dom/base/test/eventsource_message.sjs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/base/test/eventsource_message.sjs b/dom/base/test/eventsource_message.sjs new file mode 100644 index 0000000000..d52e2ee432 --- /dev/null +++ b/dom/base/test/eventsource_message.sjs @@ -0,0 +1,12 @@ +function handleRequest(request, response) { + var match = request.queryString.match(/^status=(.*)$/); + var status = match ? +match[1] : 200; + + if (status != 200) { + response.setStatusLine(request.httpVersion, status, "Err"); + } + response.setHeader("Content-Type", "text/event-stream"); + response.setHeader("Cache-Control", "no-cache"); + response.write("data: msg 1\n"); + response.write("id: 1\n\n"); +} |