summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/referrer.sjs
blob: f91c434c1679b5457387b65384a782c036d36c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function handleRequest(request, response) {
  if (request.queryString == "result") {
    response.write(getState("referer"));
    setState("referer", "INVALID");
  } else if (request.queryString == "worker") {
    response.setHeader("Content-Type", "text/javascript", false);
    response.write("onmessage = function() { postMessage(42); }");
    setState("referer", request.getHeader("referer"));
  } else if (request.queryString == "import") {
    setState("referer", request.getHeader("referer"));
    response.setHeader("Content-Type", "text/javascript", false);
    response.write("'hello world'");
  }
}