michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // SJS file that serves un-cacheable responses for STS tests that postMessage michael@0: // to the parent saying whether or not they were loaded securely. michael@0: michael@0: function handleRequest(request, response) michael@0: { michael@0: var query = {}; michael@0: request.queryString.split('&').forEach(function (val) { michael@0: var [name, value] = val.split('='); michael@0: query[name] = unescape(value); michael@0: }); michael@0: michael@0: response.setHeader("Cache-Control", "no-cache", false); michael@0: response.setHeader("Content-Type", "text/html", false); michael@0: michael@0: if ('id' in query) { michael@0: var outstr = [ michael@0: " ", michael@0: " subframe for STS", michael@0: " ", michael@0: " ", michael@0: " ", michael@0: " STS state verification frame loaded via", michael@0: " ", michael@0: " ", michael@0: " "].join("\n"); michael@0: response.write(outstr); michael@0: } else { michael@0: response.write("ERROR: no id provided"); michael@0: } michael@0: }