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 | var manifest = |
michael@0 | 2 | "CACHE MANIFEST\n" + |
michael@0 | 3 | "obsolete.html\n"; |
michael@0 | 4 | |
michael@0 | 5 | function handleRequest(request, response) |
michael@0 | 6 | { |
michael@0 | 7 | var match = request.queryString.match(/^state=(.*)$/); |
michael@0 | 8 | if (match) |
michael@0 | 9 | { |
michael@0 | 10 | response.setStatusLine(request.httpVersion, 204, "No content"); |
michael@0 | 11 | response.setHeader("Cache-Control", "no-cache"); |
michael@0 | 12 | setState("offline.obsoletingManifest", match[1]); |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | if (request.queryString == "") |
michael@0 | 16 | { |
michael@0 | 17 | switch (getState("offline.obsoletingManifest")) |
michael@0 | 18 | { |
michael@0 | 19 | case "": // The default value |
michael@0 | 20 | response.setStatusLine(request.httpVersion, 404, "Not found"); |
michael@0 | 21 | response.setHeader("Cache-Control", "no-cache"); |
michael@0 | 22 | break; |
michael@0 | 23 | case "manifestPresent": |
michael@0 | 24 | response.setStatusLine(request.httpVersion, 200, "Ok"); |
michael@0 | 25 | response.setHeader("Content-Type", "text/cache-manifest"); |
michael@0 | 26 | response.setHeader("Cache-Control", "no-cache"); |
michael@0 | 27 | response.write(manifest); |
michael@0 | 28 | break; |
michael@0 | 29 | } |
michael@0 | 30 | } |
michael@0 | 31 | } |