Polishing

This commit is contained in:
Juergen Hoeller
2020-10-06 15:31:34 +02:00
parent 1745a3f25d
commit f83bb7183e
5 changed files with 37 additions and 21 deletions

View File

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

View File

@@ -38,7 +38,6 @@ import org.springframework.core.io.buffer.PooledDataBuffer;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
/**
* {@link ClientHttpRequest} implementation for the Jetty ReactiveStreams HTTP client.
@@ -62,9 +61,7 @@ class JettyClientHttpRequest extends AbstractClientHttpRequest {
@Override
public HttpMethod getMethod() {
HttpMethod method = HttpMethod.resolve(this.jettyRequest.getMethod());
Assert.state(method != null, "Method must not be null");
return method;
return HttpMethod.valueOf(this.jettyRequest.getMethod());
}
@Override
@@ -117,7 +114,6 @@ class JettyClientHttpRequest extends AbstractClientHttpRequest {
public void succeeded() {
DataBufferUtils.release(buffer);
}
@Override
public void failed(Throwable x) {
DataBufferUtils.release(buffer);