From ee9106ff196b74076693854a5a1b3147ca85d68e Mon Sep 17 00:00:00 2001 From: mikemirzayanov Date: Sun, 24 Dec 2023 19:36:57 +0300 Subject: [PATCH] PowFilter: cookie set path root --- code/src/main/java/org/nocturne/ddos/PowFilter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/src/main/java/org/nocturne/ddos/PowFilter.java b/code/src/main/java/org/nocturne/ddos/PowFilter.java index 95087c5..457befc 100644 --- a/code/src/main/java/org/nocturne/ddos/PowFilter.java +++ b/code/src/main/java/org/nocturne/ddos/PowFilter.java @@ -178,6 +178,7 @@ private void doInternalFilter(HttpServletRequest request, HttpServletResponse re } else if (cookie != null && isResult(cookie, half)) { info("cookie != null && isResult(cookie, half): cookie=" + cookie + ", half=" + half + "."); Cookie powCookie = new Cookie("pow", sha); + powCookie.setPath("/"); powCookie.setMaxAge((int) TimeUnit.DAYS.toSeconds(1)); response.addCookie(powCookie); info("Set-Cookie: pow=" + sha + "."); @@ -185,6 +186,7 @@ private void doInternalFilter(HttpServletRequest request, HttpServletResponse re } else { info("else case: cookie=" + cookie + ", half=" + half + "."); Cookie powCookie = new Cookie("pow", half); + powCookie.setPath("/"); powCookie.setMaxAge((int) TimeUnit.DAYS.toSeconds(1)); response.addCookie(powCookie); response.setContentType("text/html");