From b0310fea65b11558b9d94d320db7b32bb6946e9a Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Tue, 12 Nov 2024 14:42:26 +0100 Subject: [PATCH] micro optimization --- .../java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java index 808aef0057..b8d0c0c8cb 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java @@ -82,11 +82,10 @@ public boolean match(final Cookie cookie, final CookieOrigin origin) { final int dotIndex = domain.indexOf('.'); if (dotIndex == 0 && domain.length() > 1 && domain.indexOf('.', 1) == -1) { final String host = origin.getHost(); - domain = domain.toLowerCase(Locale.ROOT); if (browserVersion_.hasFeature(HTTP_COOKIE_REMOVE_DOT_FROM_ROOT_DOMAINS)) { domain = domain.substring(1); } - return host.equals(domain); + return host.equalsIgnoreCase(domain); } if (dotIndex == -1