Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /** |
michael@0 | 2 | * Used with testThumbnails. |
michael@0 | 3 | * On the first visit, the page is green. |
michael@0 | 4 | * On subsequent visits, the page is red. |
michael@0 | 5 | */ |
michael@0 | 6 | |
michael@0 | 7 | function handleRequest(request, response) { |
michael@0 | 8 | let type = request.queryString.match(/^type=(.*)$/)[1]; |
michael@0 | 9 | let state = "thumbnails." + type; |
michael@0 | 10 | let color = "#0f0"; |
michael@0 | 11 | let status = 200; |
michael@0 | 12 | |
michael@0 | 13 | if (getState(state)) { |
michael@0 | 14 | color = "#f00"; |
michael@0 | 15 | if (type == "do404") |
michael@0 | 16 | status = 404; |
michael@0 | 17 | } else { |
michael@0 | 18 | setState(state, "1"); |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | response.setStatusLine(request.httpVersion, status, null); |
michael@0 | 22 | response.setHeader("Content-Type", "text/html", false); |
michael@0 | 23 | response.setHeader("Cache-Control", "no-cache", false); |
michael@0 | 24 | response.write('<html>'); |
michael@0 | 25 | response.write('<head><title>' + type + '</title> <meta charset="utf-8"> </head>'); |
michael@0 | 26 | response.write('<body style="background-color: ' + color + '"></body>'); |
michael@0 | 27 | response.write('</html>'); |
michael@0 | 28 | } |