summaryrefslogtreecommitdiffstats
path: root/dom/security/test/csp/file_bug1505412_reporter.sjs
blob: 323a4edb1c773b01707c5f5bfb3104592d90d53e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function handleRequest(request, response) {
  var receivedRequests = parseInt(getState("requests"));
  if (isNaN(receivedRequests)) {
    receivedRequests = 0;
  }
  if (request.queryString.includes("state")) {
    response.write(receivedRequests);
    return;
  }
  if (request.queryString.includes("flush")) {
    setState("requests", "0");
    response.write("OK");
    return;
  }
  receivedRequests = receivedRequests + 1;
  setState("requests", "" + receivedRequests);
  response.write("OK");
}