diff --git a/.gitignore b/.gitignore index 9219a90147297b317a318a1ced0df7df868a107a..b7f310831b88c3aebd5103e010bad375e76e7515 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ target/ /nop-idea-plugin/bin /nop_log _dump +/db diff --git a/nop-spring/nop-spring-web-starter/src/main/java/io/nop/spring/web/filter/ServletHttpServerContext.java b/nop-spring/nop-spring-web-starter/src/main/java/io/nop/spring/web/filter/ServletHttpServerContext.java index 1e467c8f5d92b1a240ff373847977ccffed389e3..da5d1116983b5db55aef99f344ef87e771d847d7 100644 --- a/nop-spring/nop-spring-web-starter/src/main/java/io/nop/spring/web/filter/ServletHttpServerContext.java +++ b/nop-spring/nop-spring-web-starter/src/main/java/io/nop/spring/web/filter/ServletHttpServerContext.java @@ -18,6 +18,7 @@ import java.net.HttpCookie; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.concurrent.Callable; import java.util.concurrent.CompletionStage; @@ -82,7 +83,10 @@ public class ServletHttpServerContext implements IHttpServerContext { public void addCookie(String sameSite, HttpCookie cookie) { Cookie retCookie = new Cookie(cookie.getName(), cookie.getValue()); retCookie.setHttpOnly(cookie.isHttpOnly()); - retCookie.setDomain(cookie.getDomain()); + // issues/I6RRQ7 + if(Objects.nonNull(cookie.getDomain())){ + retCookie.setDomain(cookie.getDomain()); + } retCookie.setPath(cookie.getPath()); retCookie.setSecure(cookie.getSecure()); retCookie.setMaxAge((int) cookie.getMaxAge());