browser/devtools/framework/test/browser_toolbox_options_disable_cache.sjs

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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 }

mercurial