summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/worker_file_getcookie.sjs
blob: b5204bdd71ec584f47b6a5a137b78cd02501fc9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */
function handleRequest(request, response) {
  try {
    var cookie = request.getHeader("Cookie");
  } catch (e) {
    cookie = "EMPTY_COOKIE";
  }

  // avoid confusing cache behaviors.
  response.setHeader("Cache-Control", "no-cache", false);
  response.setHeader("Content-type", "text/plain", false);
  response.setStatusLine(request.httpVersion, "200", "OK");
  response.write(cookie);
}