Avoid NPE in ResponseCookie on null domain

See gh-24663
This commit is contained in:
Rossen Stoyanchev 2020-03-19 12:18:29 +00:00
parent b121c0e2ea
commit a7fe6b8f5c
1 changed files with 1 additions and 1 deletions

View File

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