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.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 function handleRequest(request, response) {
5 let Etag = '"4d881ab-b03-435f0a0f9ef00"';
6 let IfNoneMatch = request.hasHeader("If-None-Match")
7 ? request.getHeader("If-None-Match")
8 : "";
10 let guid = 'xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
11 let r = Math.random() * 16 | 0;
12 let v = c === "x" ? r : (r & 0x3 | 0x8);
14 return v.toString(16);
15 });
17 let page = "<!DOCTYPE html><html><body><h1>" + guid + "</h1></body></html>";
19 response.setHeader("Etag", Etag, false);
21 if (IfNoneMatch === Etag) {
22 response.setStatusLine(request.httpVersion, "304", "Not Modified");
23 } else {
24 response.setHeader("Content-Type", "text/html; charset=utf-8", false);
25 response.setHeader("Content-Length", page.length + "", false);
26 response.write(page);
27 }
28 }