summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/tests/browser/WebRequest_dynamic.sjs
blob: 7b34a377d3af6078002826e75808899b3215344a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function handleRequest(aRequest, aResponse) {
  aResponse.setStatusLine(aRequest.httpVersion, 200);
  if (aRequest.hasHeader('Cookie')) {
    let value = aRequest.getHeader("Cookie");
    if (value == "blinky=1") {
      aResponse.setHeader("Set-Cookie", "dinky=1");
    }
    aResponse.write("cookie-present");
  } else {
    aResponse.setHeader("Set-Cookie", "foopy=1");
    aResponse.write("cookie-not-present");
  }
}