Source code
Revision control
Copy as Markdown
Other Tools
/* Any copyright is dedicated to the Public Domain.
*/
function handleRequest(request, response) {
if (request.queryString == "reset") {
setState("cache_cookie", "0");
response.setStatusLine(request.httpVersion, 200, "Ok");
response.write("Reset");
return;
}
let state = getState("cache_cookie");
if (!state) {
state = 0;
}
response.setStatusLine(request.httpVersion, 302, "Moved Temporarily");
response.setHeader("Set-Cookie", `faviconCookie=${++state}`);
response.setHeader(
"Location",
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
);
setState("cache_cookie", `${state}`);
}