Browse Source

doSetCookie 中的 if (path == null) 改为 if (StrKit.isBlank(path))。将空字符串转换为
"/"

James 4 years ago
parent
commit
998ed90d7d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main/java/com/jfinal/core/Controller.java

+ 1 - 1
src/main/java/com/jfinal/core/Controller.java

@@ -671,7 +671,7 @@ public abstract class Controller {
 		Cookie cookie = new Cookie(name, value);
 		cookie.setMaxAge(maxAgeInSeconds);
 		// set the default path value to "/"
-		if (path == null) {
+		if (StrKit.isBlank(path)) {
 			path = "/";
 		}
 		cookie.setPath(path);