let jsURL = "javascript:" + escape( 'window.parent.postMessage("JS uri ran", "*");\ return \'\ \'' ); let dataURL = "data:text/html," + escape( '\ ' ); let tests = [ // Plain document should work as normal '\ ', // refresh to plain doc { refresh: "file_bug475636.sjs?1", doc: "" }, // meta-refresh to plain doc '\
\ \ ', // refresh to data url { refresh: dataURL, doc: "" }, // meta-refresh to data url '\ \ \ ', // refresh to js url should not be followed { refresh: jsURL, doc: '\ ', }, // meta refresh to js url should not be followed '\ \ \ \ ', ]; function handleRequest(request, response) { dump("@@@@@@@@@hi there: " + request.queryString + "\n"); let test = tests[parseInt(request.queryString, 10) - 1]; response.setHeader("Content-Type", "text/html"); if (!test) { response.write(''); } else if (typeof test == "string") { response.write(test); } else if (test.refresh) { response.setHeader("Refresh", "0; url=" + test.refresh); response.write(test.doc); } }