dom/xhr/tests/file_XHRResponseURL.sjs
author moz-wptsync-bot <wptsync@mozilla.com>
Mon, 16 Apr 2018 18:38:41 +0000
changeset 1486024 3a644abd5eaa108f67471c0aae4fb4a424ea41bf
parent 788483 55a63a62c0dd798ba7ea9c5ab08d49a48588a0d4
child 1702735 dd3558a8f7ae3211ac8a9ad5f87196d6a00e7a95
permissions -rw-r--r--
Bug 1454380 [wpt PR 8508] - Update wpt metadata, a=testonly wpt-pr: 8508 wpt-type: metadata

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("Access-Control-Allow-Origin", "*", false);
  aResponse.setHeader("Cache-Control", "no-cache", false);
  aResponse.setHeader("Location", url, false);
}