summaryrefslogtreecommitdiffstats
path: root/toolkit/components/url-classifier/tests/mochitest/ping.sjs
blob: 37a78956e0dcf40183593b53f07d0b46bececbbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function handleRequest(request, response)
{
  var query = {};
  request.queryString.split('&').forEach(function (val) {
    var [name, value] = val.split('=');
    query[name] = unescape(value);
  });

  if (request.method == "POST") {
    setState(query["id"], "ping");
  } else {
    var value = getState(query["id"]);
    response.setHeader("Content-Type", "text/plain", false);
    response.write(value);
  }
}