From 469bc20e6df142076bbd8a6f7e340478ab27b680 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Wed, 7 Jun 2017 21:58:54 -0500 Subject: [PATCH] UrlUtils reuses ABSOLUTE_URL Fixes gh-4234 --- .../org/springframework/security/web/util/UrlUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/util/UrlUtils.java b/web/src/main/java/org/springframework/security/web/util/UrlUtils.java index 9f9a7fce51..0c9d645475 100644 --- a/web/src/main/java/org/springframework/security/web/util/UrlUtils.java +++ b/web/src/main/java/org/springframework/security/web/util/UrlUtils.java @@ -29,6 +29,10 @@ import javax.servlet.http.HttpServletRequest; * @author Ben Alex */ public final class UrlUtils { + + private static final Pattern ABSOLUTE_URL = Pattern.compile("\\A[a-z0-9.+-]+://.*", + Pattern.CASE_INSENSITIVE); + // ~ Methods // ======================================================================================================== @@ -140,8 +144,6 @@ public final class UrlUtils { if(url == null) { return false; } - final Pattern ABSOLUTE_URL = Pattern.compile("\\A[a-z0-9.+-]+://.*", - Pattern.CASE_INSENSITIVE); return ABSOLUTE_URL.matcher(url).matches(); }