瀏覽代碼

UrlUtils reuses ABSOLUTE_URL

Fixes gh-4234
Rob Winch 8 年之前
父節點
當前提交
469bc20e6d
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      web/src/main/java/org/springframework/security/web/util/UrlUtils.java

+ 4 - 2
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();
 	}