summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/file_XHRDocURI.sjs
blob: 275b1e96e203a491051834b0ae4b4c2acb2d8186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function handleRequest(aRequest, aResponse)
{
  var url = aRequest.queryString.match(/\burl=([^#&]*)/);
  if (!url) {
    aResponse.setStatusLine(aRequest.httpVersion, 404, "Not Found");
    return;
  }

  url = decodeURIComponent(url[1]);
  aResponse.setStatusLine(aRequest.httpVersion, 302, "Found");
  aResponse.setHeader("Cache-Control", "no-cache", false);
  aResponse.setHeader("Location", url, false);
}