Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
michael@0 | 1 | ver1manifest = |
michael@0 | 2 | "CACHE MANIFEST\n" + |
michael@0 | 3 | "# v1\n" + |
michael@0 | 4 | "\n" + |
michael@0 | 5 | "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" + |
michael@0 | 6 | "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs\n" + |
michael@0 | 7 | "\n" + |
michael@0 | 8 | "FALLBACK:\n" + |
michael@0 | 9 | "namespace1/ fallback.html\n" + |
michael@0 | 10 | "\n" + |
michael@0 | 11 | "NETWORK:\n" + |
michael@0 | 12 | "onwhitelist.html\n"; |
michael@0 | 13 | |
michael@0 | 14 | ver2manifest = |
michael@0 | 15 | "CACHE MANIFEST\n" + |
michael@0 | 16 | "# v2\n" + |
michael@0 | 17 | "\n" + |
michael@0 | 18 | "http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" + |
michael@0 | 19 | "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" + |
michael@0 | 20 | "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" + |
michael@0 | 21 | "\n" + |
michael@0 | 22 | "FALLBACK:\n" + |
michael@0 | 23 | "namespace1/ fallback.html\n" + |
michael@0 | 24 | "namespace1/sub/ fallback2.html\n"; |
michael@0 | 25 | |
michael@0 | 26 | ver3manifest = |
michael@0 | 27 | "CACHE MANIFEST\n" + |
michael@0 | 28 | "# v3\n" + |
michael@0 | 29 | "\n" + |
michael@0 | 30 | "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" + |
michael@0 | 31 | "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" + |
michael@0 | 32 | "\n" + |
michael@0 | 33 | "FALLBACK:\n" + |
michael@0 | 34 | "namespace1/sub fallback2.html\n" + |
michael@0 | 35 | "\n" + |
michael@0 | 36 | "NETWORK:\n" + |
michael@0 | 37 | "onwhitelist.html\n"; |
michael@0 | 38 | |
michael@0 | 39 | function handleRequest(request, response) |
michael@0 | 40 | { |
michael@0 | 41 | var match = request.queryString.match(/^state=(.*)$/); |
michael@0 | 42 | if (match) |
michael@0 | 43 | { |
michael@0 | 44 | response.setStatusLine(request.httpVersion, 204, "No content"); |
michael@0 | 45 | setState("offline.updatingManifest", match[1]); |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | if (request.queryString == "") |
michael@0 | 49 | { |
michael@0 | 50 | response.setStatusLine(request.httpVersion, 200, "Ok"); |
michael@0 | 51 | response.setHeader("Content-Type", "text/cache-manifest"); |
michael@0 | 52 | response.setHeader("Cache-Control", "no-cache"); |
michael@0 | 53 | switch (getState("offline.updatingManifest")) |
michael@0 | 54 | { |
michael@0 | 55 | case "": // The default value |
michael@0 | 56 | response.write(ver1manifest + "\n#" + getState("offline.updatingManifest")); |
michael@0 | 57 | break; |
michael@0 | 58 | case "second": |
michael@0 | 59 | response.write(ver2manifest + "\n#" + getState("offline.updatingManifest")); |
michael@0 | 60 | break; |
michael@0 | 61 | case "third": |
michael@0 | 62 | response.write(ver3manifest + "\n#" + getState("offline.updatingManifest")); |
michael@0 | 63 | break; |
michael@0 | 64 | } |
michael@0 | 65 | } |
michael@0 | 66 | } |