Browse Source

Avoid NPE in ResponseCookie on null domain

See gh-24663
pull/24740/head
Rossen Stoyanchev 5 years ago
parent
commit
a7fe6b8f5c
  1. 2
      spring-web/src/main/java/org/springframework/http/ResponseCookie.java

2
spring-web/src/main/java/org/springframework/http/ResponseCookie.java

@ -245,7 +245,7 @@ public final class ResponseCookie extends HttpCookie { @@ -245,7 +245,7 @@ public final class ResponseCookie extends HttpCookie {
@Nullable
private String initDomain(String domain) {
if (lenient) {
if (lenient && !StringUtils.isEmpty(domain)) {
String s = domain.trim();
if (s.startsWith("\"") && s.endsWith("\"")) {
if (s.substring(1, domain.length() - 1).trim().isEmpty()) {

Loading…
Cancel
Save