gecko/content/base/test/file_CSP.sjs
Ryan VanderMeulen 600d2857cc Backed out 2 changesets (bug 763879, bug 842657) for landing with an r-. DONTBUILD
Backed out changeset 254c1ac4ab8b (bug 842657)
Backed out changeset 58a2011beeac (bug 763879)
2013-05-16 11:15:07 -04:00

27 lines
635 B
JavaScript

// SJS file for CSP mochitests
function handleRequest(request, response)
{
var query = {};
request.queryString.split('&').forEach(function (val) {
var [name, value] = val.split('=');
query[name] = unescape(value);
});
var isPreflight = request.method == "OPTIONS";
//avoid confusing cache behaviors
response.setHeader("Cache-Control", "no-cache", false);
if ("type" in query) {
response.setHeader("Content-Type", unescape(query['type']), false);
} else {
response.setHeader("Content-Type", "text/html", false);
}
if ("content" in query) {
response.write(unescape(query['content']));
}
}