Merge branch '5.3.x'

This commit is contained in:
Stephane Nicoll
2022-07-29 17:01:28 +02:00

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2021 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -237,13 +237,13 @@ public final class ResponseCookie extends HttpCookie {
} }
@Override @Override
public ResponseCookieBuilder domain(String domain) { public ResponseCookieBuilder domain(@Nullable String domain) {
this.domain = initDomain(domain); this.domain = initDomain(domain);
return this; return this;
} }
@Nullable @Nullable
private String initDomain(String domain) { private String initDomain(@Nullable String domain) {
if (lenient && StringUtils.hasLength(domain)) { if (lenient && StringUtils.hasLength(domain)) {
String str = domain.trim(); String str = domain.trim();
if (str.startsWith("\"") && str.endsWith("\"")) { if (str.startsWith("\"") && str.endsWith("\"")) {
@@ -256,7 +256,7 @@ public final class ResponseCookie extends HttpCookie {
} }
@Override @Override
public ResponseCookieBuilder path(String path) { public ResponseCookieBuilder path(@Nullable String path) {
this.path = path; this.path = path;
return this; return this;
} }
@@ -311,12 +311,12 @@ public final class ResponseCookie extends HttpCookie {
/** /**
* Set the cookie "Path" attribute. * Set the cookie "Path" attribute.
*/ */
ResponseCookieBuilder path(String path); ResponseCookieBuilder path(@Nullable String path);
/** /**
* Set the cookie "Domain" attribute. * Set the cookie "Domain" attribute.
*/ */
ResponseCookieBuilder domain(String domain); ResponseCookieBuilder domain(@Nullable String domain);
/** /**
* Add the "Secure" attribute to the cookie. * Add the "Secure" attribute to the cookie.