【fix sonar】 CookieUtil.java文件
This commit is contained in:
+6
-3
@@ -16,6 +16,9 @@ public class CookieUtil {
|
|||||||
// 保存路径,根路径
|
// 保存路径,根路径
|
||||||
private static final String COOKIE_PATH = "/";
|
private static final String COOKIE_PATH = "/";
|
||||||
|
|
||||||
|
private CookieUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -70,9 +73,9 @@ public class CookieUtil {
|
|||||||
* @param key
|
* @param key
|
||||||
*/
|
*/
|
||||||
private static Cookie get(HttpServletRequest request, String key) {
|
private static Cookie get(HttpServletRequest request, String key) {
|
||||||
Cookie[] arr_cookie = request.getCookies();
|
Cookie[] arrCookie = request.getCookies();
|
||||||
if (arr_cookie != null && arr_cookie.length > 0) {
|
if (arrCookie != null && arrCookie.length > 0) {
|
||||||
for (Cookie cookie : arr_cookie) {
|
for (Cookie cookie : arrCookie) {
|
||||||
if (cookie.getName().equals(key)) {
|
if (cookie.getName().equals(key)) {
|
||||||
return cookie;
|
return cookie;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user