summaryrefslogtreecommitdiffstats
path: root/dom/security/test/general/file_framing_error_pages.sjs
blob: bf669283cccbb4ff82c0ff99faebefa22d5e195e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"use strict";

function handleRequest(request, response) {

  response.setHeader("Cache-Control", "no-cache", false);
  response.setHeader("Content-Type", "text/html", false);

  let query = request.queryString;
  if (query === "xfo") {
    response.setHeader("x-frame-options", "deny", false);
    response.write("<html>xfo test loaded</html>");
    return;
  }

  if (query === "csp") {
    response.setHeader("content-security-policy", "frame-ancestors 'none'", false);
    response.write("<html>csp test loaded</html>");
    return;
  }

  // we should never get here, but just in case
  // return something unexpected
  response.write("do'h");
}