docs: function sanitisePath(path, queueObject) {
      // Remove first slash (as we set one later.)
      path = path.replace(/^\//, "");
  
      var pathStack = [];
  
      // Trim whitespace. If no path is present - assume index.html.
      var sanitisedPath = path.length ? path.replace(/\s*$/ig, "") : "index.html";
      var headers = queueObject.stateData.headers, sanitisedPathParts;
  
      if (sanitisedPath.match(/\?/)) {
          sanitisedPathParts = sanitisedPath.split(/\?/g);
          var resource = sanitisedPathParts.shift();
          var hashedQS = crypto.createHash("sha1").update(sanitisedPathParts.join("?")).digest("hex");
          sanitisedPath = resource + "?" + hashedQS;
      }
  
      pathStack = sanitisedPath.split(/\//g);
      pathStack = pathStack.map(function(pathChunk) {
          if (pathChunk.length >= 250) {
              return crypto.createHash("sha1").update(pathChunk).digest("hex");
          }
  
          return pathChunk;
      });
  
      sanitisedPath = pathStack.join("/");
  
      // Try to get a file extension for the file - for ease of identification
      // We run through this if we either:
      //  1) haven't got a file extension at all, or:
      //  2) have an HTML file without an HTML file extension (might be .php, .aspx, .do, or some other server-processed type)
  
      if (!sanitisedPath.match(/\.[a-z0-9]{1,6}$/i) || headers["content-type"] && headers["content-type"].match(/text\/html/i) && !sanitisedPath.match(/\.htm[l]?$/i)) {
          var subMimeType = "";
          var mimeParts = [];
  
          if (headers["content-type"] && headers["content-type"].match(/text\/html/i)) {
              if (sanitisedPath.match(/\/$/)) {
                  sanitisedPath += "index.html";
              } else {
                  sanitisedPath += ".html";
              }
  
          } else if (headers["content-type"] && (mimeParts = headers["content-type"].match(/(image|video|audio|application)\/([a-z0-9]+)/i))) {
              subMimeType = mimeParts[2];
              sanitisedPath += "." + subMimeType;
          }
      }
  
      return sanitisedPath;
  }