From b59da5ade431a7da253a1cad948e517a736b844f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 23 May 2009 18:35:45 +0200 Subject: [PATCH] Match method to detect a client token to the way a client token is generated. --- src/net/pterodactylus/jsite/core/RequestManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/net/pterodactylus/jsite/core/RequestManager.java b/src/net/pterodactylus/jsite/core/RequestManager.java index 831c9b3..df4d1cc 100644 --- a/src/net/pterodactylus/jsite/core/RequestManager.java +++ b/src/net/pterodactylus/jsite/core/RequestManager.java @@ -120,11 +120,17 @@ public class RequestManager implements NodeListener { if (projectIdString.length() != (IdGenerator.DEFAULT_LENGTH * 2)) { return false; } + int clientTokenHashCode = -1; try { Hex.toByte(projectIdString); + Long.valueOf(clientTokenParts[1]); + clientTokenHashCode = Integer.valueOf(clientTokenParts[2]); } catch (NumberFormatException nfe1) { return false; } + if ((clientTokenParts[0] + "." + clientTokenParts[1]).hashCode() != clientTokenHashCode) { + return false; + } return true; } -- 2.7.4